Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions ros_gz_example_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,13 @@ project(ros_gz_example_gazebo)
find_package(ament_cmake REQUIRED)
find_package(ros_gz_example_description REQUIRED)

find_package(gz-cmake3 REQUIRED)
find_package(gz-plugin2 REQUIRED COMPONENTS register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})
find_package(gz-common5 REQUIRED COMPONENTS profiler)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

# Harmonic
if("$ENV{GZ_VERSION}" STREQUAL "harmonic")
find_package(gz-sim8 REQUIRED)
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})
message(STATUS "Compiling against Gazebo Harmonic")
# Default to Garden
else()
find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})
message(STATUS "Compiling against Gazebo Garden")
endif()
find_package(gz_plugin_vendor REQUIRED)
find_package(gz-plugin REQUIRED COMPONENTS register)
find_package(gz_common_vendor REQUIRED)
find_package(gz-common REQUIRED COMPONENTS profiler)
find_package(gz_sim_vendor REQUIRED)
find_package(gz-sim REQUIRED)



# Following 'add_library' directive defines a library target named 'BasicSystem'.
Expand All @@ -52,7 +42,7 @@ target_include_directories(
# be linked to anoter target.
# ${GZ_SIM_VER} is substituted by the value that is was set to above.
target_link_libraries(BasicSystem PRIVATE
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER})
gz-sim::gz-sim)


# Following directives similarly specify another target: 'FullSystem'.
Expand All @@ -66,7 +56,7 @@ target_include_directories(
)

target_link_libraries(FullSystem PRIVATE
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER})
gz-sim::gz-sim)



Expand Down
6 changes: 5 additions & 1 deletion ros_gz_example_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
<author>Dharini Dutia</author>

<depend>ros_gz_example_description</depend>

<depend>gz_sim_vendor</depend>
<depend>gz_cmake_vendor</depend>
<depend>gz_plugin_vendor</depend>
<depend>gz_common_vendor</depend>

<buildtool_depend>ament_cmake</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
Expand Down