forked from jasp-stats/jasp-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
71 lines (57 loc) · 1.81 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
# This will build the CommonData library
#
# On Linux,
# - We need to link to the `librt.so`, and for some reason, CMake cannot find it
# easily, so, Libraries module tries to find it and provides it to CommonData here.
# - Since we are not using Conan, I link to the libjsoncpp, using the PkgConfig variables
#
#
list(APPEND CMAKE_MESSAGE_CONTEXT CommonData)
make_includable(internalDbDefinition.sql internalDbDefinition.h)
file(GLOB_RECURSE HEADER_FILES "${CMAKE_CURRENT_LIST_DIR}/*.h")
file(GLOB_RECURSE SOURCE_FILES "${CMAKE_CURRENT_LIST_DIR}/*.cpp")
file(GLOB_RECURSE SQL_FILES "${CMAKE_CURRENT_LIST_DIR}/*.sql")
add_library(CommonData STATIC ${SOURCE_FILES} ${HEADER_FILES} ${SQL_FILES})
if(LINUX)
target_link_libraries(CommonData PUBLIC ${_LIB_RT})
target_link_options(CommonData PUBLIC -lrt)
endif()
target_include_directories(
CommonData
PUBLIC # JASP
${PROJECT_SOURCE_DIR}/Common
${PROJECT_SOURCE_DIR}/Common/jaspColumnEncoder
# R
${R_INCLUDE_PATH}
${R_HOME_PATH}/include
${RCPP_PATH}/include
${Boost_INCLUDE_DIRS}
PRIVATE
SQLite::SQLite3
)
target_link_libraries(
CommonData
PUBLIC
LibArchive::LibArchive
# Common
SQLite::SQLite3
)
target_compile_definitions(
CommonData PUBLIC
$<$<BOOL:${JASP_TIMER_USED}>:PROFILE_JASP>
JSONCPP_NO_LOCALE_SUPPORT )
if(APPLE)
target_compile_definitions(CommonData PUBLIC BOOST_INTERPROCESS_SHARED_DIR_FUNC)
elseif(WINDOWS)
target_compile_definitions(
CommonData
PUBLIC BOOST_INTERPROCESS_BOOTSTAMP_IS_SESSION_MANAGER_BASED
BOOST_WINDOWS
NOMINMAX
WIN32_LEAN_AND_MEAN)
endif()
if(IWYU_EXECUTABLE AND RUN_IWYU)
set_target_properties(CommonData PROPERTIES CXX_INCLUDE_WHAT_YOU_USE
${IWYU_EXECUTABLE})
endif()
list(POP_BACK CMAKE_MESSAGE_CONTEXT)