Skip to content
Merged
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
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ gz_find_package (Qt5

#--------------------------------------
# Find gz-sim
gz_find_package(gz-sim10 REQUIRED PRIVATE COMPONENTS gui)
set(GZ_SIM_VER ${gz-sim10_VERSION_MAJOR})
gz_find_package(gz-sim REQUIRED PRIVATE COMPONENTS gui)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal opinion here is that a configuration instructions should encode the known versions that work and specially the versions that are known not to work.

If we know that this is going to fail with gz-sim less than 10, let's encode it.

Suggested change
gz_find_package(gz-sim REQUIRED PRIVATE COMPONENTS gui)
gz_find_package(gz-sim REQUIRED VERSION 10 PRIVATE COMPONENTS gui)

Copy link
Member Author

@scpeters scpeters Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had suggested in the shorter proposal gazebo-tooling/release-tools#1244 (comment) that we not use explicit version numbers when calling find_package on the main branch, but that we add it in when creating stable release branches

  • Finding Gazebo packages with cmake's find_package function:
    • On main branches: the major version number should not be used when finding a package with cmake’s find_package() function. For example: find_package(gz-utils4 REQUIRED COMPONENTS log) should instead be find_package(gz-utils REQUIRED COMPONENTS log). This helps reduce maintenance churn on the main branches.
    • When branching from main to create stable release branches: add explicit major versions into the find_package calls like find_package(gz-utils 4 REQUIRED COMPONENTS log). This generates configuration errors when incompatible versions are built together, which is helpful.

I think this will reduce churn on the main branches, while still providing helpful error messages for stable release branches

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah sorry, did not get that in mind. Sound fine.


gz_pkg_check_modules(websockets libwebsockets)
if (NOT websockets_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<depend>gz-math8</depend>
<depend>gz-msgs11</depend>
<depend>gz-plugin3</depend>
<depend>gz-sim10</depend>
<depend>gz-sim</depend>
<depend>gz-tools2</depend>
<depend>gz-transport14</depend>
<depend>libgflags-dev</depend>
Expand Down
2 changes: 1 addition & 1 deletion plugins/sim_factory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_library(${plugin_lower} SHARED ${sources})
target_link_libraries(${plugin_lower}
PRIVATE
${PROJECT_LIBRARY_TARGET_NAME}
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
gz-sim::gz-sim
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-transport${GZ_TRANSPORT_VER}::core
gz-plugin${GZ_PLUGIN_VER}::core
Expand Down
6 changes: 3 additions & 3 deletions plugins/sim_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ add_library(${plugin_lower} SHARED ${sources})
target_link_libraries(${plugin_lower}
PRIVATE
${PROJECT_LIBRARY_TARGET_NAME}
gz-sim${GZ_SIM_VER}
gz-sim${GZ_SIM_VER}::gui
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
gz-sim
gz-sim::gui
gz-sim::gz-sim
gz-gui${GZ_GUI_VER}::gz-gui${GZ_GUI_VER}
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-transport${GZ_TRANSPORT_VER}::core
Expand Down
2 changes: 1 addition & 1 deletion plugins/sim_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_library(${plugin_lower} SHARED ${sources})
target_link_libraries(${plugin_lower}
PRIVATE
${PROJECT_LIBRARY_TARGET_NAME}
gz-sim${GZ_SIM_VER}::gz-sim${GZ_SIM_VER}
gz-sim::gz-sim
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-transport${GZ_TRANSPORT_VER}::core
gz-plugin${GZ_PLUGIN_VER}::core
Expand Down