-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
238 lines (223 loc) · 5.57 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
cmake_minimum_required (VERSION 2.8)
project(scatdb C CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMakeRules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
#set(CMAKE_MODULE_PATH
#${CMAKE_MODULE_PATH}
#"${CMAKE_SOURCE_DIR}/CMakeRules"
# "${CMAKE_CURRENT_SOURCE_DIR}"
#)
include(addBaseProject)
include(addBoostUniform)
include(adddocs)
include(addapp)
include(addlib)
include(generaterc)
include(GetGitRevisionDescription)
include(addInstallDirs)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(addapp)
include(addlib)
set(MAJOR 2)
set(MINOR 0)
set(REVISION 2)
set(SCATDB_VERSION
${MAJOR}.${MINOR}.${REVISION} )
addBaseProject()
addInstallDirs(scatdb)
addBoostUniform(filesystem program_options system iostreams date_time )
include_directories(BEFORE SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})
link_directories(${Boost_LIBRARY_DIR_DEBUG})
link_directories(${Boost_LIBRARY_DIR_RELEASE})
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
find_package(HDF5 COMPONENTS C CXX REQUIRED)
include_directories(${HDF5_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR_CPP})
add_definitions(${HDF5_DEFINITIONS})
set(HDF5_USE_STATIC_LIBRARIES OFF)
if(DEFINED HDF5_C_LIBRARIES)
set (h5libs ${HDF5_C_LIBRARIES} ${HDF5_CXX_LIBRARIES})
else()
set (h5libs hdf5-shared hdf5_hl-shared hdf5_cpp-shared hdf5_hl_cpp-shared)
endif()
if(NOT ZLIB_INCLUDE_DIR)
if (DEFINED ENV{ZLIB_ROOT})
set(ZLIB_ROOT $ENV{ZLIB_ROOT})
ENDIF()
endif()
find_package(ZLIB)
if (ZLIB_FOUND)
set(COMPRESS_ZLIB 1)
set(COMPRESS_GZIP 1)
include_directories(${ZLIB_INCLUDE_DIRS})
#set(liblist ${liblist} ${ZLIB_LIBRARIES})
endif()
set(COMPRESS_SZIP 0)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeBase/cmake-settings.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake-settings.h"
)
generaterc("scatdb" "dll"
"scatdb"
"Particle scattering database of Ryan Honeyager, Guosheng Liu and Holly Nowell"
"${CMAKE_CURRENT_BINARY_DIR}/lib.rc"
)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeBase/module-scatdb.in"
"${CMAKE_CURRENT_BINARY_DIR}/Modules/scatdb"
)
set (REL_BIN_DIR bin)
set (REL_LIB_DIR lib)
include_directories("${CMAKE_CURRENT_BINARY_DIR}")
SET(scatdb_os
src/os_functions_common.cpp
private/os_functions_common.hpp
src/os_functions_linux.cpp
private/os_functions_linux.hpp
src/os_functions_freebsd.cpp
private/os_functions_freebsd.hpp
src/os_functions_win.cpp
private/os_functions_win.hpp
)
SET(scatdb_debug
src/debug.cpp
scatdb/debug.hpp
src/error.cpp
scatdb/error.hpp
src/errorTypes.cpp
scatdb/errorTypes.hpp
src/hash.cpp
scatdb/hash.hpp
scatdb/hashForwards.hpp
private/info.hpp
private/info_fwd.hpp
src/logging.cpp
scatdb/logging.hpp
src/MurmurHash3.cpp
private/MurmurHash3.h
src/options.cpp
private/options.hpp
scatdb/optionsForwards.hpp
src/splitSet.cpp
scatdb/splitSet.hpp
src/versioning.cpp
private/versioning.hpp
private/versioningForwards.hpp
private/versioningGenerate.hpp
)
SET(scatdb_main
src/export-hdf5.cpp
scatdb/export-hdf5.hpp
scatdb/defs.h
scatdb/defs.hpp
scatdb/lowess.hpp
scatdb/scatdb.h
scatdb/scatdb.hpp
scatdb/scatdb_liu.h
scatdb/zeros.hpp
src/scatdb.cpp
src/scatdb_c.cpp
src/scatdb_stats.cpp
src/filters.cpp
src/lowess.cpp
src/io.cpp
src/io_hdf5.cpp
src/io_simple.cpp
src/scatdb_liu.c
src/scatdb_liu_supplemental.cpp
src/zeros.cpp
)
set(scatdb_shape
src/chainHull.cpp
private/chainHull.hpp
src/shape.cpp
src/shapeAlgsProj.cpp
src/shapeIO.cpp
src/shapeIOhdfRead.cpp
src/shapeIOhdfWrite.cpp
#src/shapeIOtext.cpp
src/shapeIOtextParsers.cpp
scatdb/shape/shape.hpp
scatdb/shape/shapeIO.hpp
scatdb/shape/shapeAlgs.hpp
scatdb/shape/shapeForwards.hpp
private/shapeBackend.hpp
private/shapeIOtext.hpp
)
set(scatdb_refract
scatdb/refract/refract.hpp
scatdb/refract/refractBase.hpp
src/refract.cpp
src/refractImpl.cpp
private/linterp.h
#src/refractStore.cpp
#private/refractBackend.hpp
)
SET(scatdb_units
src/units.cpp
src/unitsPlugins.cpp
src/unitsSimple.cpp
scatdb/units/units.hpp
scatdb/units/unitsPlugins.hpp
private/unitsBackend.hpp
)
set(scatdb_docs
LICENSE
README.md
changelog.md
dbformat.md
INSTALL.md
)
source_group("Docs" FILES ${scatdb_docs})
SOURCE_GROUP("OS" FILES ${scatdb_os})
SOURCE_GROUP("Debug" FILES ${scatdb_debug})
source_group("Main" FILES ${scatdb_main})
source_group("Shape" FILES ${scatdb_shape})
source_group("Refract" FILES ${scatdb_refract})
source_group("Units" FILES ${scatdb_units})
set( scatdb_srcs
${scatdb_main}
${scatdb_debug}
${scatdb_os}
${scatdb_refract}
${scatdb_shape}
${scatdb_units}
${scatdb_docs}
"${CMAKE_CURRENT_BINARY_DIR}/Modules/scatdb"
"${CMAKE_CURRENT_BINARY_DIR}/cmake-settings.h"
)
IF (WIN32 AND NOT CYGWIN)
SET(scatdb_srcs ${scatdb_srcs}
"${CMAKE_CURRENT_BINARY_DIR}/lib.rc")
ENDIF()
add_library (scatdb SHARED
${scatdb_srcs}
)
if(WIN32 AND NOT CYGWIN)
set(libs ${h5libs})
else()
set (libs ${h5libs} ${Boost_FILESYSTEM_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_SYSTEM_LIBRARY})
endif()
# OS_DEP_LIBS is set in addBaseProject.cmake
target_link_libraries(scatdb ${libs} ${OS_DEP_LIBS})
addlib(scatdb SHARED)
storebin(scatdb "Libraries")
INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/share/scatdb.csv
${CMAKE_CURRENT_SOURCE_DIR}/share/scatdb.hdf5
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/scatdb
COMPONENT Data
)
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/Modules/scatdb"
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/scatdb/Modules
COMPONENT Data
)
INSTALL(DIRECTORY scatdb
DESTINATION ${INSTALL_INCLUDE_DIR}
COMPONENT Headers
)
ADD_SUBDIRECTORY(apps)
adddocs()