-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
71 lines (60 loc) · 2.67 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_minimum_required(VERSION 3.1)
project(rttopp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE AND CMAKE_BUILD_TYPE MATCHES Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
set(JSON_BuildTests
OFF
CACHE INTERNAL "")
add_subdirectory(external/json)
find_package(benchmark REQUIRED)
find_package(Boost REQUIRED)
find_package(Eigen3 REQUIRED)
set(GTest_ROOT /usr/src/googletest/googletest)
add_subdirectory(${GTest_ROOT} "${CMAKE_CURRENT_BINARY_DIR}/googletest"
EXCLUDE_FROM_ALL)
enable_testing()
add_compile_options(
-Wall
-Wextra
-fdiagnostics-color=always
-Wpedantic
-Wredundant-decls
-Wcast-qual
-Wfloat-equal
-Wshadow)
add_library(${PROJECT_NAME} src/demo_trajectories.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_link_libraries(${PROJECT_NAME} PUBLIC Eigen3::Eigen
nlohmann_json::nlohmann_json)
add_executable(param_random_waypoints_example_generic
examples/param_random_waypoints_generic.cpp)
target_link_libraries(param_random_waypoints_example_generic
PRIVATE ${PROJECT_NAME})
add_executable(param_random_waypoints_example_iiwa
examples/param_random_waypoints_iiwa.cpp)
target_link_libraries(param_random_waypoints_example_iiwa
PRIVATE ${PROJECT_NAME})
add_executable(param_random_waypoints_generic_sampling_example
examples/param_random_waypoints_generic_sampling.cpp)
target_link_libraries(param_random_waypoints_generic_sampling_example
PRIVATE ${PROJECT_NAME})
add_executable(param_failed_random_waypoints_example_generic
examples/param_failed_random_waypoints_generic.cpp)
target_link_libraries(param_failed_random_waypoints_example_generic
PRIVATE ${PROJECT_NAME} stdc++fs)
add_executable(path_velocity_limit_tests tests/path_velocity_limit.cpp)
target_link_libraries(path_velocity_limit_tests PRIVATE ${PROJECT_NAME}
gtest_main)
add_test(NAME path_velocity_limit_tests COMMAND path_velocity_limit_tests)
add_executable(preprocessing_tests tests/test_preprocessing.cpp)
target_link_libraries(preprocessing_tests PRIVATE ${PROJECT_NAME} gtest_main)
add_test(NAME preprocessing_tests COMMAND preprocessing_tests)
add_executable(param_tests tests/param.cpp)
target_link_libraries(param_tests PRIVATE ${PROJECT_NAME} gtest_main)
add_test(NAME param_tests COMMAND param_tests)