-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
99 lines (77 loc) · 3.02 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
cmake_minimum_required(VERSION 3.0.2)
project(RBase
VERSION 0.9.0)
set(BUILD_NUMBER "0" CACHE STRING "Build-Number")
set(VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}+${BUILD_NUMBER})
option(testing "Enable building tests" ON)
option(BUILD_SWIG "Enable building SWIG modules." FALSE)
option(INSTALL_RBASE "Enable installing and building of RBase, including SWIG modules." FALSE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(AdditionalCatchParameters -o report.xml -r junit)
get_directory_property(hasParent PARENT_DIRECTORY)
if(hasParent)
else()
set(INSTALL_RBASE TRUE)
set(BUILD_SWIG TRUE)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(STATUS "GCC compiler detected.")
set (CMAKE_CXX_FLAGS "-std=gnu++14 ${CMAKE_CXX_FLAGS}")
endif ()
SET(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC ON)
set(Boost_USE_MULTITHREADED OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
if(NOT Boost_FOUND OR NOT Boost_log_FOUND OR NOT Boost_serialization_FOUND)
find_package(Boost COMPONENTS log_setup log serialization REQUIRED)
endif()
add_subdirectory(RCore)
add_subdirectory(RUtil)
add_subdirectory(RComm)
add_subdirectory(RRegistry)
add_subdirectory(RSupport)
include(basename_setter)
define_file_basename_for_sources(rutil)
define_file_basename_for_sources(rutils)
define_file_basename_for_sources(rcomm)
define_file_basename_for_sources(rregistry)
define_file_basename_for_sources(rregistrys)
define_file_basename_for_sources(rsupport)
define_file_basename_for_sources(rsupports)
if(BUILD_SWIG)
add_subdirectory(swig)
endif()
get_directory_property(hasParent PARENT_DIRECTORY)
if(NOT hasParent)
if(BUILD_TESTS)
add_subdirectory(RCore/test)
endif()
endif()
if(INSTALL_RBASE)
# Installation logic, only executed if there is no parent!
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Support library for writing regulation kernels and other software around RMaster")
set(CPACK_PACKAGE_NAME "RBase")
set(CPACK_PACKAGE_VENDOR "Harptech")
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESSOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md)
set(CPACK_RESSOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/packages)
set(CPACK_PACKAGE_CONTACT "Max Heisinger <mail@maximaximal.com>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"python3, python3-numpy,
libpython3.4 | libpython3.5 | libpython3.6,
libboost-serialization1.55.0 | libboost-serialization1.58.0 | libboost-serialization1.62.0")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
include(CPack)
else()
set(RRegistry_INCLUDE_DIRS
${RRegistry_INCLUDE_DIRS}
PARENT_SCOPE)
endif()