-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathCMakeLists.txt
139 lines (106 loc) · 2.88 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
project(darling-dmg)
cmake_minimum_required(VERSION 3.13)
set(dmg_sources
src/unichar.cpp
src/Reader.cpp
src/FileReader.cpp
src/HFSVolume.cpp
src/AppleDisk.cpp
src/SubReader.cpp
src/HFSBTree.cpp
src/HFSFork.cpp
src/HFSCatalogBTree.cpp
src/HFSExtentsOverflowBTree.cpp
src/HFSAttributeBTree.cpp
src/DMGDisk.cpp
src/DMGPartition.cpp
src/DMGDecompressor.cpp
src/adc.cpp
src/HFSZlibReader.cpp
src/MemoryReader.cpp
src/GPTDisk.cpp
src/MacBinary.cpp
src/ResourceFork.cpp
src/CacheZone.cpp
src/CachedReader.cpp
src/HFSHighLevelVolume.cpp
)
# This part of CMakeLists.txt is for when building darling-dmg
# as a standalone FUSE module outside of Darling.
if (NOT DARLING)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
add_definitions(-D_FILE_OFFSET_BITS=64)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -ggdb -O0")
include(FindLibXml2)
find_package(LibXml2 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
if (WITH_TESTS)
enable_testing()
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
add_definitions(-DBOOST_TEST_DYN_LINK ) # -DDEBUG
set(CacheTest_SRC
test/CacheTest.cpp
src/CacheZone.cpp
src/CachedReader.cpp
src/Reader.cpp
src/MemoryReader.cpp
)
add_executable(CacheTest ${CacheTest_SRC})
target_link_libraries(CacheTest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_test(NAME CacheTest COMMAND CacheTest)
endif (WITH_TESTS)
add_library(dmg SHARED
src/unichar.cpp
src/Reader.cpp
src/FileReader.cpp
src/HFSVolume.cpp
src/AppleDisk.cpp
src/SubReader.cpp
src/HFSBTree.cpp
src/HFSFork.cpp
src/HFSCatalogBTree.cpp
src/HFSExtentsOverflowBTree.cpp
src/HFSAttributeBTree.cpp
src/DMGDisk.cpp
src/DMGPartition.cpp
src/DMGDecompressor.cpp
src/adc.cpp
src/HFSZlibReader.cpp
src/MemoryReader.cpp
src/GPTDisk.cpp
src/MacBinary.cpp
src/ResourceFork.cpp
src/CacheZone.cpp
src/CachedReader.cpp
src/HFSHighLevelVolume.cpp
)
target_link_libraries(dmg -licuuc -lcrypto -lz -lbz2 ${LIBXML2_LIBRARY})
install(TARGETS dmg DESTINATION lib)
add_executable(darling-dmg
src/main-fuse.cpp
)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
target_link_libraries(darling-dmg -lfuse dmg)
install(TARGETS darling-dmg RUNTIME DESTINATION bin)
# This is used in Darling build.
else (NOT DARLING)
include(wrap_elf)
include(darling_exe)
include(FindPkgConfig)
add_definitions(-D_FILE_OFFSET_BITS=64 -DCOMPILE_WITH_LZFSE=1)
pkg_check_modules(FUSE REQUIRED fuse)
include_directories(
${FUSE_INCLUDE_DIRS}
)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -nostdinc")
wrap_elf(fuse libfuse.so)
add_darling_executable(hdiutil
${dmg_sources}
src/main-hdiutil.cpp
)
target_link_libraries(hdiutil fuse icucore z bz2 crypto44 xml2 iconv lzfse)
install(TARGETS hdiutil DESTINATION libexec/darling/usr/bin)
endif (NOT DARLING)