-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
54 lines (45 loc) · 1.86 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
cmake_minimum_required(VERSION 3.5)
set(PROJECT_NAME dynamic_trajectory_generator)
project(${PROJECT_NAME})
# Default to C++17
set(CMAKE_CXX_STANDARD 17)
add_compile_options(-fPIC)
find_package(Eigen3 REQUIRED)
add_subdirectory(subpackages/mav_trajectory_generation)
# CPP matplotlib workaround
# set (CMAKE_CXX_FLAGS " -I/usr/include/python3.8 -lpython3.8")
# add_subdirectory(subpackages/matplotlib_cpp)
# include_directories(subpackages/matplotlib_cpp)
# include(cmake_extern_dependencies/matplotlib_cpp_dependencies.cmake)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
set(SOURCE_CPP_FILES
src/dynamic_trajectory.cpp
src/dynamic_waypoint.cpp
)
include_directories(
include
include/${PROJECT_NAME}
${EIGEN3_INCLUDE_DIRS}
# ${MATPLOTLIB_CPP_INCLUDE_DIRS}
)
# add_executable(${PROJECT_NAME}_node src/main_trajectory_publisher.cpp ${SOURCE_CPP_FILES} ${HEADER_HPP_FILES})
# target_link_libraries(${PROJECT_NAME}_node nlopt glog::glog
#create library and export it
add_library(${PROJECT_NAME} ${SOURCE_CPP_FILES})
target_link_libraries(${PROJECT_NAME} mav_trajectory_generation nlopt )
target_include_directories(${PROJECT_NAME} PUBLIC include include/${PROJECT_NAME} ${EIGEN3_INCLUDE_DIRS} )
#check if tests are enabled
if (${PROJECT_NAME}_TESTS_ENABLED)
# CPP matplotlib workaround
message(STATUS "Compilation tests enabled")
set (CMAKE_CXX_FLAGS " -I/usr/include/python3.8 -lpython3.8")
add_subdirectory(subpackages/matplotlib_cpp)
include_directories(subpackages/matplotlib_cpp)
include_directories(matplotlib_cpp_INCLUDE_DIRS)
add_executable(compilation_tests tests/compilation_tests.cpp )
target_link_libraries(compilation_tests ${PROJECT_NAME} mav_trajectory_generation python3.8)
# set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-fPIC")
# include(tests/profiling_cmake.cmake)
endif()