-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
58 lines (48 loc) · 1.32 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
cmake_minimum_required(VERSION 3.14)
project(
cddp_mpc
VERSION 0.1.0
DESCRIPTION "CDDP-MPC module for ROS2"
HOMEPAGE_URL "https://github.com/astomodynamics/cddp_mpc"
)
set(CMAKE_CXX_STANDARD 17) # Enforce C++17 as the minimum standard
set(CMAKE_CXX_STANDARD_REQUIRED ON) # Enforce C++17 as the minimum standard
set(ABSL_PROPAGATE_CXX_STD ON) # Enforce C++17 for absl
set(CMAKE_BUILD_TYPE "Release") # Set the build type to Release by default
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
# Enable FetchContent for downloading dependencies
include(FetchContent)
# CDDP
FetchContent_Declare(
cddp
GIT_REPOSITORY https://github.com/astomodynamics/cddp-cpp
GIT_TAG origin/master
)
FetchContent_MakeAvailable(cddp)
add_executable(mpc_node src/mpc_node.cpp)
ament_target_dependencies(mpc_node
rclcpp
geometry_msgs
nav_msgs
Eigen3
)
target_link_libraries(mpc_node
cddp
)
install(TARGETS
mpc_node
DESTINATION lib/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()