-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
152 lines (110 loc) · 4.26 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
set(ATSDB_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
message(" Path: ${ATSDB_PATH}")
cmake_minimum_required(VERSION 3.3)
set ( CMAKE_BUILD_TYPE RelWithDebInfo ) #Debug RelWithDebInfo Release
project( jASTERIX )
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
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 -UNDEBUG -std=c++11) # -Wno-int-in-bool-context
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
#set(CMAKE_AUTOMOC ON)
add_library(jasterix "")
set (USE_LOG4CPP true)
message("USE_LOG4CPP: ${USE_LOG4CPP}")
set (USE_OPENSSL true)
message("USE_OPENSSL: ${USE_OPENSSL}")
configure_file(include/jasterix/global.h.in include/jasterix/global.h)
find_package ( Boost 1.73.0 COMPONENTS program_options filesystem iostreams regex system REQUIRED)
message(" Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
message(" Boost_LIBRARY_DIR: ${Boost_LIBRARY_DIR}")
message(" Boost_LIBRARIES: ${Boost_LIBRARIES}")
find_package(Threads REQUIRED)
include_directories (
${Boost_INCLUDE_DIRS}
${ATSDB_PATH}/include/
)
link_directories(
${Boost_LIBRARY_DIR}
)
target_link_libraries ( jasterix
${Boost_LIBRARIES}
Threads::Threads
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH};${ATSDB_PATH}/cmake_modules)
message(" CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
IF (USE_LOG4CPP)
find_package ( LOG4CPP REQUIRED )
message(" LOG4CPP_INCLUDE_DIR: ${LOG4CPP_INCLUDE_DIR}")
message(" LOG4CPP_LIBRARY: ${LOG4CPP_LIBRARIES}")
target_link_libraries ( jasterix
${LOG4CPP_LIBRARIES}
)
ENDIF()
IF (USE_OPENSSL)
find_package ( OpenSSL REQUIRED )
message(" OPENSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
message(" OPENSSL_CRYPTO_LIBRARY: ${OPENSSL_CRYPTO_LIBRARY}")
target_link_libraries ( jasterix
${OPENSSL_CRYPTO_LIBRARY}
)
ENDIF()
find_package(TBB REQUIRED)
find_package ( LibArchive REQUIRED )
message(" LibArchive_INCLUDE_DIRS: ${LibArchive_INCLUDE_DIRS}")
message(" LibArchive_LIBRARIES: ${LibArchive_LIBRARIES}")
message("Install path: ${CMAKE_INSTALL_PREFIX}")
include(lib/CMakeLists.txt)
include(include/jasterix/CMakeLists.txt)
include(src/CMakeLists.txt)
include_directories (
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}/include
${Boost_INCLUDE_DIRS}
${LibArchive_INCLUDE_DIRS}
)
target_link_libraries ( jasterix
#${TBB_LIBRARIES}
TBB::tbb
${LibArchive_LIBRARIES}
${Boost_LIBRARIES}
)
target_sources(jasterix
PUBLIC
"${LIB_DIR}/json.hpp"
PRIVATE
)
message("Installing using prefix: ${CMAKE_INSTALL_PREFIX}")
#install(DIRECTORY "specifications" DESTINATION jasterix)
set_target_properties(jasterix PROPERTIES PUBLIC_HEADER
"include/jasterix/jasterix.h;include/jasterix/category.h;include/jasterix/editionbase.h;include/jasterix/edition.h;include/jasterix/refedition.h;include/jasterix/ref.h;include/jasterix/spfedition.h;include/jasterix/spf.h;include/jasterix/mapping.h;include/jasterix/frameparser.h;include/jasterix/record.h;include/jasterix/iteminfo.h;include/jasterix/itemparserbase.h;build/include/jasterix/global.h")
#install (TARGETS jasterix DESTINATION lib)
install (TARGETS jasterix DESTINATION lib
PUBLIC_HEADER DESTINATION include/jasterix)
install (TARGETS jasterix_client DESTINATION bin)
#install(FILES src/jasterix.h DESTINATION include)
# 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")