-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
106 lines (92 loc) · 2.83 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 3.5)
project(gazebo_mocap4r2_plugin)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# we dont use add_compile_options with pedantic in message packages
# because the Python C extensions dont comply with it
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
endif()
if(WIN32)
add_compile_definitions(
# For math constants
_USE_MATH_DEFINES
# Minimize Windows namespace collision
NOMINMAX
WIN32_LEAN_AND_MEAN
)
endif()
find_package(ament_cmake REQUIRED)
find_package(gazebo_dev REQUIRED)
find_package(gazebo_msgs REQUIRED)
find_package(gazebo_ros REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(mocap4r2_msgs REQUIRED)
find_package(mocap4r2_control REQUIRED)
find_package(rclcpp REQUIRED)
link_directories(${gazebo_dev_LIBRARY_DIRS})
option(ENABLE_PROFILER "Enable Ignition Profiler" FALSE)
if(ENABLE_PROFILER)
find_package(ignition-common3 QUIET COMPONENTS profiler)
if(ignition-common3_FOUND)
add_definitions("-DIGN_PROFILER_ENABLE=1" "-DIGN_PROFILER_REMOTERY=1")
message(STATUS "Profiler is active")
else()
message(WARNING "Can't find Ignition common3. Profiler will not be actived")
add_definitions("-DIGN_PROFILER_ENABLE=0" "-DIGN_PROFILER_REMOTERY=0")
endif()
endif()
# gazebo_ros_mocap
add_library(gazebo_ros_mocap SHARED
src/gazebo_ros_mocap.cpp
)
target_include_directories(gazebo_ros_mocap PUBLIC include)
ament_target_dependencies(gazebo_ros_mocap
"gazebo_dev"
"gazebo_ros"
"rclcpp"
"mocap4r2_msgs"
"mocap4r2_control"
"geometry_msgs"
)
ament_export_libraries(gazebo_ros_mocap)
ament_export_include_directories(include)
ament_export_dependencies(rclcpp)
ament_export_dependencies(gazebo_dev)
ament_export_dependencies(gazebo_msgs)
ament_export_dependencies(gazebo_ros)
ament_export_dependencies(mocap_msgs)
ament_export_dependencies(mocap_control)
ament_export_dependencies(geometry_msgs)
if(BUILD_TESTING)
add_subdirectory(test)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
if(NOT WIN32)
if(NOT APPLE)
set(
AMENT_CMAKE_ENVIRONMENT_HOOKS_DESC_gazebo_plugins
"prepend-non-duplicate;LD_LIBRARY_PATH;${GAZEBO_PLUGIN_PATH}")
else()
set(
AMENT_CMAKE_ENVIRONMENT_HOOKS_DESC_gazebo_plugins
"prepend-non-duplicate;DYLD_LIBRARY_PATH;${GAZEBO_PLUGIN_PATH}")
endif()
endif()
ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/gazebo_plugins.sh.in")
ament_package()
install(DIRECTORY include/
DESTINATION include)
install(TARGETS
gazebo_ros_mocap
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(DIRECTORY
launch urdf rviz models
DESTINATION share/${PROJECT_NAME}/
)