-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
47 lines (39 loc) · 1.19 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
cmake_minimum_required(VERSION 3.8)
project(volksbot_driver VERSION 1.0.3)
# Configure C++ compiler
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(epos2_motor_controller REQUIRED)
# Add executable and link external dependencies
add_executable(volksbot src/volksbot_node.cpp)
ament_target_dependencies(volksbot geometry_msgs nav_msgs sensor_msgs tf2_ros epos2_motor_controller)
target_include_directories(volksbot
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
# Install the launch directory and urdfs
install(DIRECTORY
launch
config
urdf
meshes
DESTINATION share/${PROJECT_NAME}/
)
# Install binaries
install(TARGETS
volksbot
DESTINATION lib/${PROJECT_NAME})
ament_package()