Skip to content

Commit

Permalink
Gazebo: add support for Harmonic
Browse files Browse the repository at this point in the history
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
  • Loading branch information
srmainwaring committed Dec 17, 2023
1 parent 962b33a commit 63c31c6
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 26 deletions.
86 changes: 62 additions & 24 deletions gz-waves/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,73 @@ gz_find_package(gz-common5
)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

#--------------------------------------
# Find gz-msgs
gz_find_package(gz-msgs9 REQUIRED)
set(GZ_MSGS_VER ${gz-msgs9_VERSION_MAJOR})

#--------------------------------------
# Find gz-transport
gz_find_package(gz-transport12 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})

#--------------------------------------
# Find gz-plugin
gz_find_package(gz-plugin2 REQUIRED COMPONENTS loader register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

#--------------------------------------
# Find gz-rendering
gz_find_package(gz-rendering7 REQUIRED)
set(GZ_RENDERING_VER ${gz-rendering7_VERSION_MAJOR})

#--------------------------------------
# Find gz-sim
gz_find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

#--------------------------------------
# Find SDFormat
gz_find_package(sdformat13 REQUIRED)
set(SDF_VER ${sdformat13_VERSION_MAJOR})
# Garden (default)
if("$ENV{GZ_VERSION}" STREQUAL "garden" OR NOT DEFINED "ENV{GZ_VERSION}")

#--------------------------------------
# Find gz-msgs
gz_find_package(gz-msgs9 REQUIRED)
set(GZ_MSGS_VER ${gz-msgs9_VERSION_MAJOR})

#--------------------------------------
# Find gz-transport
gz_find_package(gz-transport12 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport12_VERSION_MAJOR})

#--------------------------------------
# Find gz-rendering
gz_find_package(gz-rendering7 REQUIRED)
set(GZ_RENDERING_VER ${gz-rendering7_VERSION_MAJOR})

#--------------------------------------
# Find gz-sim
gz_find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

#--------------------------------------
# Find SDFormat
gz_find_package(sdformat13 REQUIRED)
set(SDF_VER ${sdformat13_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Garden")

# Harmonic
elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic")

#--------------------------------------
# Find gz-msgs
gz_find_package(gz-msgs10 REQUIRED)
set(GZ_MSGS_VER ${gz-msgs10_VERSION_MAJOR})

#--------------------------------------
# Find gz-transport
gz_find_package(gz-transport13 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})

#--------------------------------------
# Find gz-rendering
gz_find_package(gz-rendering8 REQUIRED)
set(GZ_RENDERING_VER ${gz-rendering8_VERSION_MAJOR})

#--------------------------------------
# Find gz-sim
gz_find_package(gz-sim8 REQUIRED)
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})

#--------------------------------------
# Find SDFormat
gz_find_package(sdformat14 REQUIRED)
set(SDF_VER ${sdformat14_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Harmonic")
else()
message(FATAL_ERROR "Unsupported GZ_VERSION: $ENV{GZ_VERSION}")
endif()

#--------------------------------------
# Find OGRE
Expand Down
22 changes: 20 additions & 2 deletions gz-waves/src/gui/plugins/waves_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ project(WavesControl)

set(CMAKE_AUTOMOC ON)

find_package(gz-sim7 REQUIRED COMPONENTS gui)
# Garden (default)
if("$ENV{GZ_VERSION}" STREQUAL "garden" OR NOT DEFINED "ENV{GZ_VERSION}")

find_package(gz-sim7 REQUIRED COMPONENTS gui)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Garden")

# Harmonic
elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic")

find_package(gz-sim8 REQUIRED COMPONENTS gui)
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Harmonic")
else()
message(FATAL_ERROR "Unsupported GZ_VERSION: $ENV{GZ_VERSION}")
endif()


QT5_ADD_RESOURCES(resources_RCC ${PROJECT_NAME}.qrc)

Expand All @@ -17,5 +35,5 @@ add_library(${PROJECT_NAME} SHARED
${resources_RCC}
)
target_link_libraries(${PROJECT_NAME}
PRIVATE gz-sim7::gui
PRIVATE gz-sim${GZ_SIM_VER}::gui
)

0 comments on commit 63c31c6

Please sign in to comment.