]> FriiDump Source - friidump.git/blob - libfriidump/CMakeLists.txt
0670c8712cc9c73b09f8b3dcde9be090639901d3
[friidump.git] / libfriidump / CMakeLists.txt
1 # Create a library called "Hello" which includes the source file "hello.cxx".
2 # The extension is already found.  Any number of sources could be listed here.
3 add_library (
4         friidumplib
5         ${libfriidump_type}
6         #SHARED
7         #STATIC
8         
9         brickblocker.h
10         brickblocker.c
11         byteorder.h
12         constants.h
13         disc.h
14         disc.c
15         dumper.h
16         dumper.c
17         dvd_drive.h
18         dvd_drive.c
19         hitachi.c
20         ecma-267.h
21         ecma-267.c
22         lite-on.c
23         misc.h
24         misc.c
25         renesas.c
26         rs.h
27         rs.c
28         unscrambler.h
29         unscrambler.c
30         vanilla_2064.c
31         vanilla_2384.c
32         win32compat.h
33         win32compat.c
34         xbox_ref_bridge.h
35         xbox_ref_bridge.c
36         xbox_xgd1_raw_id_probe.c
37         xbox_ref/xbox_ref_log.c
38 )
39
40 if (WIN32)
41         target_sources (friidumplib PRIVATE
42                 xbox_ref/utils.c
43                 xbox_ref/unlock.c
44                 xbox_ref/rc4.c
45                 xbox_ref/xbox_ref_sha1.c
46         )
47         target_include_directories (friidumplib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/xbox_ref)
48 endif (WIN32)
49
50 set_target_properties (friidumplib PROPERTIES OUTPUT_NAME "friidump")
51
52 include_directories (
53         ${FriiDump_SOURCE_DIR}/libmultihash
54 )
55
56 # Make sure the linker can find the Hello library once it is built.
57 link_directories (
58         ${FriiDump_BINARY_DIR}/libmultihash
59 )
60
61 # Link the executable to the Hello library.
62 target_link_libraries (
63         friidumplib
64         
65         multihashlib
66 )
67
68 # Before making a release, the LTVERSION string should be modified.
69 # The string is of the form CURRENT:REVISION:AGE.
70 #
71 # CURRENT (C)
72 # The most recent interface number that this library implements.
73 #
74 # REVISION (R)
75 # The implementation number that this library implements.
76 #
77 # AGE (A)
78 # The difference between the newest and oldest interfaces that this
79 # library implements. In other works, the library implements all the
80 # interface numbers in the range from number 'CURRENT - AGE' to
81 # 'CURRENT'.
82 #
83 # This means that:
84 #
85 #   - If interfaces have been changed or added, but binary compatibility has
86 #     been preserved, change to C+1:0:A+1
87 #
88 #   - If binary compatibility has been broken (eg removed or changed
89 #     interfaces) change to C+1:0:0
90 #
91 #   - If the interface is the same as the previous version, change to C:R+1:A
92 #
93 #set_target_properties (friidumplib PROPERTIES SOVERSION 1.0.0)
94
95
96 # Windows stuff to correctly build DLL or static library
97 #get_target_property (libfriidump_type friidumplib TYPE)
98 if (WIN32)
99         if (libfriidump_type STREQUAL "SHARED")
100 #               MESSAGE ("Building libfriidump DLL")
101                 ADD_DEFINITIONS (-DFRIIDUMPLIB_BUILD_DLL)
102                 set_target_properties (friidumplib PROPERTIES DEFINE_SYMBOL FRIIDUMPLIB_EXPORTS)
103
104                 install (
105                         TARGETS friidumplib
106                         RUNTIME DESTINATION /
107                         #ARCHIVE DESTINATION lib
108                 )
109         endif (libfriidump_type STREQUAL "SHARED")
110 else (WIN32)
111         # Install stuff, only if a shared library is being built
112         if (libfriidump_type STREQUAL "SHARED")
113                 install (
114                         TARGETS friidumplib
115                         LIBRARY DESTINATION lib
116                         ARCHIVE DESTINATION lib/static
117                 )
118         endif (libfriidump_type STREQUAL "SHARED")
119 endif (WIN32)