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