]> FriiDump Source - friidump.git/blob - libfriidump/CMakeLists.txt
Document exact-release Linux hardware validation
[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         nintendo_disc_header.h
26         nintendo_disc_header.c
27         renesas.c
28         rs.h
29         rs.c
30         unscrambler.h
31         unscrambler.c
32         vanilla_2064.c
33         vanilla_2384.c
34         win32compat.h
35         win32compat.c
36         xbox_region.h
37         xbox_region.c
38         xbox_portable.h
39         xbox_portable.c
40         xbox_ref_bridge.h
41         xbox_ref_bridge.c
42         xbox_xgd1_raw_id_probe.c
43         xbox_ref/xbox_ref_log.c
44 )
45
46 if (WIN32)
47         target_sources (friidumplib PRIVATE
48                 xbox_ref/utils.c
49                 xbox_ref/unlock.c
50                 xbox_ref/rc4.c
51                 xbox_ref/xbox_ref_sha1.c
52         )
53         target_include_directories (friidumplib PRIVATE
54                 ${FriiDump_SOURCE_DIR}/libmultihash
55                 ${CMAKE_CURRENT_SOURCE_DIR}/xbox_ref
56         )
57 endif (WIN32)
58
59 set_target_properties (friidumplib PROPERTIES OUTPUT_NAME "friidump")
60
61 include_directories (
62         ${FriiDump_SOURCE_DIR}/libmultihash
63 )
64
65 # Make sure the linker can find the Hello library once it is built.
66 link_directories (
67         ${FriiDump_BINARY_DIR}/libmultihash
68 )
69
70 # Link the executable to the Hello library.
71 target_link_libraries (
72         friidumplib
73         
74         multihashlib
75 )
76
77 # Before making a release, the LTVERSION string should be modified.
78 # The string is of the form CURRENT:REVISION:AGE.
79 #
80 # CURRENT (C)
81 # The most recent interface number that this library implements.
82 #
83 # REVISION (R)
84 # The implementation number that this library implements.
85 #
86 # AGE (A)
87 # The difference between the newest and oldest interfaces that this
88 # library implements. In other works, the library implements all the
89 # interface numbers in the range from number 'CURRENT - AGE' to
90 # 'CURRENT'.
91 #
92 # This means that:
93 #
94 #   - If interfaces have been changed or added, but binary compatibility has
95 #     been preserved, change to C+1:0:A+1
96 #
97 #   - If binary compatibility has been broken (eg removed or changed
98 #     interfaces) change to C+1:0:0
99 #
100 #   - If the interface is the same as the previous version, change to C:R+1:A
101 #
102 #set_target_properties (friidumplib PROPERTIES SOVERSION 1.0.0)
103
104
105 # Windows stuff to correctly build DLL or static library
106 #get_target_property (libfriidump_type friidumplib TYPE)
107 if (WIN32)
108         if (libfriidump_type STREQUAL "SHARED")
109 #               MESSAGE ("Building libfriidump DLL")
110                 ADD_DEFINITIONS (-DFRIIDUMPLIB_BUILD_DLL)
111                 set_target_properties (friidumplib PROPERTIES DEFINE_SYMBOL FRIIDUMPLIB_EXPORTS)
112
113                 install (
114                         TARGETS friidumplib
115                         RUNTIME DESTINATION /
116                         #ARCHIVE DESTINATION lib
117                 )
118         endif (libfriidump_type STREQUAL "SHARED")
119 else (WIN32)
120         # Install stuff, only if a shared library is being built
121         if (libfriidump_type STREQUAL "SHARED")
122                 install (
123                         TARGETS friidumplib
124                         LIBRARY DESTINATION lib
125                         ARCHIVE DESTINATION lib/static
126                 )
127         endif (libfriidump_type STREQUAL "SHARED")
128 endif (WIN32)