-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathCMakeLists.txt
94 lines (70 loc) · 2.71 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
cmake_minimum_required(VERSION 3.10)
# set the project name
project(fastest-lap VERSION 0.5)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/include)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
option(CHECK_BOUNDS "Enable bounds check at runtime" OFF)
option(ENABLE_TESTS "Enable testing" ON)
option(PYTHON_API_ABSOLUTE_PATH "Use absolute paths to look for libraries in the python API" ON)
message("")
message(" Configure third party libraries ")
message(" =============================== ")
message("")
include(get-third-party)
message("")
execute_process(COMMAND
${CMAKE_COMMAND} -E env CLICOLOR_FORCE=1
${CMAKE_COMMAND} -E cmake_echo_color --green "-> [DONE]"
)
message("")
## Configure doxygen
include(Doxygen)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_EXTENSIONS ON)
# 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)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# 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)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")
# default build type is Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
message(" Configure Fastest-lap")
message(" =====================")
message("")
include_directories(./)
# Google tests
enable_testing()
list(APPEND CMAKE_CTEST_ARGUMENTS "--verbose")
# Compile the subdirectories
include(compilerflags)
include(matlabutils)
add_subdirectory(./src)
if ( ${PYTHON_API_ABSOLUTE_PATH} )
set(libdir_python ${CMAKE_BINARY_DIR}/lib)
else()
file(RELATIVE_PATH libdir_python ${CMAKE_SOURCE_DIR}/examples/python/ ${CMAKE_BINARY_DIR}/lib)
endif()
if ( MSYS AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
set(CONSTRUCT_LIBFASTESTLAPC OFF)
else()
set(CONSTRUCT_LIBFASTESTLAPC ON)
endif()
if (${CONSTRUCT_LIBFASTESTLAPC})
configure_file(${CMAKE_SOURCE_DIR}/src/main/python/fastest_lap.py ${CMAKE_SOURCE_DIR}/examples/python/fastest_lap.py)
file(GENERATE OUTPUT ${CMAKE_SOURCE_DIR}/examples/python/fastest_lap.py INPUT ${CMAKE_SOURCE_DIR}/examples/python/fastest_lap.py)
endif()
install(DIRECTORY "${CMAKE_BINARY_DIR}/thirdparty/lib/"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")