forked from MaxPacheco02/sdv_description_gz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
109 lines (92 loc) · 3.34 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
107
108
109
cmake_minimum_required(VERSION 3.8)
project(sdv_description_gz)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(std_srvs)
find_package(geometry_msgs)
find_package(sensor_msgs)
find_package(rclcpp REQUIRED)
# COPIED FROM VRX_GZ's github repository
find_package(ament_cmake_python REQUIRED)
find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})
find_package(gz-common5 REQUIRED COMPONENTS graphics)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})
find_package(gz-fuel_tools8 REQUIRED)
find_package(gz-math7 REQUIRED)
set(GZ_MATH_VER ${gz-math7_VERSION_MAJOR})
find_package(gz-msgs9 REQUIRED)
find_package(gz-transport12 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})
find_package(gz-plugin2 REQUIRED COMPONENTS loader register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
find_package(gz-rendering7 REQUIRED)
set(GZ_RENDERING_VER ${gz-rendering7_VERSION_MAJOR})
find_package(gz-sensors7 REQUIRED)
set(GZ_SENSORS_VER ${gz-sensors7_VERSION_MAJOR})
find_package(gz-utils2 REQUIRED)
set(GZ_UTILS_VER ${gz-utils2_VERSION_MAJOR})
find_package(sdformat13 REQUIRED)
find_package(std_msgs REQUIRED)
find_package(Eigen3 REQUIRED)
#============================================================================
# Hooks
ament_environment_hooks("hooks/resource_paths.dsv.in")
ament_environment_hooks("hooks/resource_paths.sh")
#============================================================================
foreach(PLUGIN ${SDV_DESCRIPTION_GZ_PLUGINS})
add_library(${PLUGIN} SHARED src/${PLUGIN}.cc)
target_link_libraries(${PLUGIN} PUBLIC
gz-sim${GZ_SIM_VER}::core
gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER}
gz-rendering${GZ_RENDERING_VER}::gz-rendering${GZ_RENDERING_VER}
gz-sensors${GZ_SENSORS_VER}::gz-sensors${GZ_SENSORS_VER}
gz-utils${GZ_UTILS_VER}::gz-utils${GZ_UTILS_VER}
Waves
Eigen3::Eigen
)
endforeach()
add_executable(ros_ackermann_bridge src/ros_ackermann_bridge.cpp)
target_include_directories(ros_ackermann_bridge PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(ros_ackermann_bridge PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
ament_target_dependencies(
ros_ackermann_bridge
rclcpp
std_msgs
)
ament_python_install_package(
sdv_description_gz
PACKAGE_DIR src/sdv_description_gz
)
#============================================================================
# Resources
install(DIRECTORY
launch
models
rviz
worlds
DESTINATION share/${PROJECT_NAME})
install(
TARGETS ${SDV_DESCRIPTION_GZ_PLUGINS}
ros_ackermann_bridge
DESTINATION lib/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()