-
Notifications
You must be signed in to change notification settings - Fork 84
/
CMakeLists.txt
71 lines (54 loc) · 2.34 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
# -*- cmake -*-
# the cmake version used in the travis integration build
# older versions may still work but have not been tested
cmake_minimum_required(VERSION 3.9.2)
PROJECT(vanilla-rtb CXX)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
FIND_PACKAGE(Boost 1.67.0 REQUIRED)
#disable the search for boost-cmake.
SET(Boost_NO_BOOST_CMAKE ON)
FIND_PACKAGE(Threads)
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0")
MESSAGE(FATAL_ERROR "The build has not been tested with GCC version < 7.0, to proceed at your own risk comment this message out in the top level CMakeLists.txt")
ENDIF()
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb")
ENDIF()
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET ( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/examples )
ENDIF()
message("CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}")
message("CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}")
message("CMAKE_CURRENT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}")
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
IF (UNIX AND NOT APPLE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../lib64")
#ELSE ( APPLE )
# set(CMAKE_INSTALL_NAME_DIR "@rpath")
# set(CMAKE_INSTALL_RPATH "@executable_path/../lib;@excutable_path/../lib64;@loader_path")
ELSE (UNIX AND NOT APPLE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib64")
ENDIF (UNIX AND NOT APPLE)
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
#Install CRUD libraries
#file(GLOB CRUD_LIB ${CMAKE_CURRENT_BINARY_DIR}/CRUD/service/*.so)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CRUD/service/libcrud_service.so DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
enable_testing()
add_subdirectory(jsonv)
add_subdirectory(CRUD)
add_subdirectory(rtb)
add_subdirectory(parsers)
IF(NOT DEFINED VANILLA_NO_EXAMPLES)
add_subdirectory(examples)
ENDIF()
add_subdirectory(tests)
add_subdirectory(benchmarks)