forked from hpuhr/COMPASS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
199 lines (150 loc) · 5.42 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
set(ATSDB_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
message(" Path: ${ATSDB_PATH}")
cmake_minimum_required(VERSION 3.1)
set ( CMAKE_BUILD_TYPE Debug )
set(CMAKE_CXX_FLAGS_MYREL "-O3")
#set ( CMAKE_BUILD_TYPE Release )
project( ATSDB )
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
message(" System: ${CMAKE_SYSTEM}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
message(" Platform: Linux")
add_definitions ( -Wall -std=c++11 -Wno-int-in-bool-context)
find_package(Qt5Widgets)
find_package(Qt5Core)
find_package(Qt5OpenGL)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
#add_definitions(${Qt5Widgets_DEFINITIONS})
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
find_package ( Boost REQUIRED COMPONENTS regex system program_options filesystem iostreams)
message(" Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}")
message(" Boost_LIBRARY_DIR: ${Boost_LIBRARY_DIR}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${ATSDB_PATH}/cmake_modules)
message(" CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
find_package (Eigen3 3.2 REQUIRED)
find_package ( MySQLpp REQUIRED )
message(" MySQLpp_INCLUDE_DIR: ${MySQLpp_INCLUDE_DIR}")
message(" MySQLpp_LIBRARY: ${MySQLpp_LIBRARY}")
find_package ( MySQL REQUIRED )
message(" MYSQL_INCLUDE_DIR: ${MYSQL_INCLUDE_DIR}")
message(" MYSQL_LIBRARY: ${MYSQL_LIBRARY}")
find_package ( Sqlite3 REQUIRED )
message(" SQLite3_INCLUDE_DIR: ${SQLITE3_INCLUDE_DIR}")
message(" SQLite3_LIBRARY_DIR: ${SQLITE3_LIBRARIES}")
find_package ( LOG4CPP REQUIRED )
message(" LOG4CPP_INCLUDE_DIR: ${LOG4CPP_INCLUDE_DIR}")
message(" LOG4CPP_LIBRARY: ${LOG4CPP_LIBRARIES}")
find_package ( GDAL REQUIRED )
message(" GDAL_INCLUDE_DIRS: ${GDAL_INCLUDE_DIRS}")
message(" GDAL_LIBRARIES: ${GDAL_LIBRARIES}")
find_package ( TinyXML2 REQUIRED )
message(" TINYXML2_INCLUDE_DIR: ${TINYXML2_INCLUDE_DIR}")
message(" TINYXML2_LIBRARY: ${TINYXML2_LIBRARY}")
find_package ( LibArchive REQUIRED )
message(" LibArchive_INCLUDE_DIRS: ${LibArchive_INCLUDE_DIRS}")
message(" LibArchive_LIBRARIES: ${LibArchive_LIBRARIES}")
find_package(TBB REQUIRED)
message(" TBB_INCLUDE_DIRS: ${TBB_INCLUDE_DIRS}")
message(" TBB_LIBRARIES: ${TBB_LIBRARIES}")
find_package ( jASTERIX )
message(" jASTERIX found: ${jASTERIX_FOUND}")
message(" jASTERIX_INCLUDE_DIR: ${jASTERIX_INCLUDE_DIR}")
message(" jASTERIX_LIBRARIES: ${jASTERIX_LIBRARIES}")
#find_package ( JSONCPP REQUIRED )
#message(" JSONCPP_INCLUDE_DIR: ${JSONCPP_INCLUDE_DIR}")
#message(" JSONCPP_LIBRARY: ${JSONCPP_LIBRARY}")
add_library(atsdb "")
message("Install path: ${CMAKE_INSTALL_PREFIX}")
include(src/CMakeLists.txt)
set (EXPERIMENTAL_SRC true)
message("Experimental source: ${EXPERIMENTAL_SRC}")
IF (EXPERIMENTAL_SRC)
IF(IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/experimental_src")
MESSAGE(STATUS "Experimental source found")
ELSE()
MESSAGE(STATUS "Experimental source not found found, deactivating")
set (EXPERIMENTAL_SRC false)
ENDIF()
ENDIF()
IF (EXPERIMENTAL_SRC)
MESSAGE(STATUS "Including experimental source")
include(experimental_src/CMakeLists.txt)
ENDIF()
configure_file(src/util/global.h.in include/global.h)
# includes and library linking
include_directories (
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}/include
${Qt5Widgets_INCLUDE_DIRS}
${Qt5OpenGL_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${SQLITE3_INCLUDE_DIR}
${MYSQL_INCLUDE_DIR}
${MySQLpp_INCLUDE_DIR}
${LOG4CPP_INCLUDE_DIR}
${GDAL_INCLUDE_DIRS}
${TINYXML2_INCLUDE_DIR}
${OPENSCENEGRAPH_INCLUDE_DIRS}
${LibArchive_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${JSONCPP_INCLUDE_DIR}
)
link_directories(
${Boost_LIBRARY_DIR}
)
IF (jASTERIX_FOUND)
include_directories (
${jASTERIX_INCLUDE_DIR}
)
link_directories(
${jASTERIX_LIBRARIES}
)
target_link_libraries ( atsdb
${jASTERIX_LIBRARIES})
ENDIF()
target_link_libraries ( atsdb optimized
Qt5::Widgets
Qt5::Core
Qt5::OpenGL
${TINYXML2_LIBRARY}
${Boost_LIBRARIES}
${LOG4CPP_LIBRARIES}
${MySQLpp_LIBRARY}
${MYSQL_LIBRARY}
${GDAL_LIBRARIES}
${SQLITE3_LIBRARIES}
${LibArchive_LIBRARIES}
${JSONCPP_LIBRARY}
${TBB_LIBRARIES})
# installation stuff
message("Installing using prefix: ${CMAKE_INSTALL_PREFIX}")
install(DIRECTORY "conf" DESTINATION atsdb)
install(DIRECTORY "data" DESTINATION atsdb)
install (TARGETS atsdb DESTINATION lib
PUBLIC_HEADER DESTINATION include/atsdb)
install (TARGETS atsdb_client DESTINATION bin)
# build a CPack driven installer package
include (InstallRequiredSystemLibraries)
set (CPACK_RESOURCE_FILE_LICENSE
"${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
include (CPack)
# add a target to generate API documentation with Doxygen
#find_package(Doxygen)
#if(DOXYGEN_FOUND)
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in @ONLY)
# add_custom_target(doc
# ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
# COMMENT "Generating API documentation with Doxygen" VERBATIM
# )
#endif(DOXYGEN_FOUND)
#file(GLOB DOT ".*")
#file(GLOB TILD "*~")
#file(GLOB TEMP "*.cmake")