-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (37 loc) · 1.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
cmake_minimum_required(VERSION 3.13)
project(mpc_tracker LANGUAGES CXX)
# set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "-g -fopenmp -Wall")# Debug mode
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fopenmp -Wall")# release mode
# place binaries and libraries according to GNU standards
include(GNUInstallDirs)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
# we cannot analyse results without gcov
find_program(GCOV_PATH gcov)
if(NOT GCOV_PATH)
message(FATAL_ERROR "Code coverage analysis requires gcov!")
endif()
# Find Eigen
find_package( Eigen3 REQUIRED )
if(${EIGEN3_FOUND})
message("-- Found Eigen version ${EIGEN3_VERSION}: ${EIGEN3_INCLUDE_DIRS}")
else()
message(STATUS "Eigen3 is NOT found")
endif()
# public include
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${EIGEN3_INCLUDE_DIR})
add_subdirectory(src)
add_subdirectory(example)
# Tests
option(PATHTRACKTOOLS_BUILD_TESTS "Build tests" OFF)
message(STATUS "Build tests: ${PATHTRACKTOOLS_BUILD_TESTS}")
if (PATHTRACKTOOLS_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()