Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
#============================================================================
# Initialize the project
#============================================================================
project(gz-launch9 VERSION 9.0.0)
project(gz-launch VERSION 9.0.0)

#============================================================================
# Find gz-cmake
Expand Down Expand Up @@ -88,8 +88,8 @@ 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.

set(GZ_SIM_VER ${gz-sim_VERSION_MAJOR})
Copy link
Member Author

Choose a reason for hiding this comment

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

we could alternatively delete the GZ_SIM_VER variable since I believe it is not used after these changes

Copy link
Member Author

Choose a reason for hiding this comment

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

removed in 28765fe


gz_pkg_check_modules(websockets libwebsockets)
if (NOT websockets_FOUND)
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>gz-launch9</name>
<name>gz-launch</name>
<version>9.0.0</version>
<description>Gazebo Launch : Run and manage programs and plugins</description>
<maintainer email="natekoenig@gmail.com">Nate Koenig</maintainer>
Expand All @@ -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
8 changes: 4 additions & 4 deletions plugins/sim_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ 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-gui${GZ_GUI_VER}::gz-gui${GZ_GUI_VER}
gz-sim
gz-sim::gui
gz-sim::gz-sim
gz-gui::gz-gui${GZ_GUI_VER}
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
gz-transport${GZ_TRANSPORT_VER}::core
gz-plugin${GZ_PLUGIN_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
7 changes: 6 additions & 1 deletion src/cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ target_link_libraries(gz PUBLIC
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
)

set(launch_executable gz-launch)
# Define the desired output name of the executable
set(launch_executable_output_name gz-launch)
# Append "-exe" to cmake target name to differ from the library target name
set(launch_executable gz-launch-exe)
add_executable(${launch_executable} launch_main.cc)
set_target_properties(${launch_executable}
PROPERTIES OUTPUT_NAME ${launch_executable_output_name})
target_link_libraries(${launch_executable}
gz
gz-utils${GZ_UTILS_VER}::cli
Expand Down