From 933b53b955dae8dd4398521f16a5f75b55d60147 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 31 Jul 2025 22:17:20 +0000 Subject: [PATCH 1/6] Jetty support: bump to 9.0.0, fix package names Major version numbers have been removed from package names in Gazebo Jetty, so extra cmake config files are no longer needed. Signed-off-by: Steve Peters --- CMakeLists.txt | 43 ++++------------------------------ gz-math-config.cmake.in | 14 +++++------ gz_math_vendor-extras.cmake.in | 1 - 3 files changed, 11 insertions(+), 47 deletions(-) delete mode 100644 gz_math_vendor-extras.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 930d667..559178d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.10) project(gz_math_vendor) # Project-specific settings -set(LIB_VER_MAJOR 8) -set(LIB_VER_MINOR 2) +set(LIB_VER_MAJOR 9) +set(LIB_VER_MINOR 0) set(LIB_VER_PATCH 0) set(LIB_VER_SUFFIX "") @@ -13,7 +13,7 @@ set(LIB_NAME gz-math) set(GITHUB_NAME gz-math) string(REPLACE "-" "_" LIB_NAME_UNDERSCORE ${LIB_NAME}) set(LIB_NAME_COMP_PREFIX ${LIB_NAME}) -set(LIB_NAME_FULL ${LIB_NAME}${LIB_VER_MAJOR}) +set(LIB_NAME_FULL ${LIB_NAME}) set(LIB_VER ${LIB_VER_MAJOR}.${LIB_VER_MINOR}.${LIB_VER_PATCH}) find_package(ament_cmake_core REQUIRED) @@ -72,39 +72,4 @@ if(NOT ${${LIB_NAME_FULL}_FOUND}) ament_environment_hooks("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.sh") endif() -# The goal is to support versionless package names once the user has found the -# vendor package. Example usage: -# -# find_package(gz_sim_vendor) -# find_package(gz-sim VERSION 8.2.0) # Note gz-sim not gz-sim8 -# -# To accomplish this, we create a `{LIB_NAME}-config.cmake` file that does -# find_package on the underlying package and sets up CMake targets with the -# same name as the original targets sans the version number in the target. -# -# However, since the vendor package is built with `GLOBAL_HOOK`, we can't -# install the `-config.cmake` file we're creating here to where the versioned -# `-config.cmake` from the underlying package is located. If we did, users can -# `find_package` the versionless package without first finding the vendor -# package. Thus, we install the `-config.cmake` file to a nonstandard -# location: `opt/${PROJECT_NAME}/extra_cmake/` and provide a -# `{vendor_name}-extras.cmake` file that adds that path to `CMAKE_PREFIX_PATH`. -ament_package( - CONFIG_EXTRAS_POST "gz_math_vendor-extras.cmake.in" -) - -include(CMakePackageConfigHelpers) -include(GNUInstallDirs) - -configure_package_config_file(${LIB_NAME}-config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}-config.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${LIB_NAME}) - -write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}-config-version.cmake - VERSION ${LIB_VER} - COMPATIBILITY SameMajorVersion) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}-config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}-config-version.cmake - DESTINATION "opt/${PROJECT_NAME}/extra_cmake/lib/cmake/${LIB_NAME}") +ament_package() diff --git a/gz-math-config.cmake.in b/gz-math-config.cmake.in index 56d06dd..74dc46e 100644 --- a/gz-math-config.cmake.in +++ b/gz-math-config.cmake.in @@ -1,24 +1,24 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) -find_package(@LIB_NAME@@LIB_VER_MAJOR@ ${@LIB_NAME@_FIND_VERSION} REQUIRED COMPONENTS ${@LIB_NAME@_FIND_COMPONENTS}) +find_package(@LIB_NAME@ ${@LIB_NAME@_FIND_VERSION} REQUIRED COMPONENTS ${@LIB_NAME@_FIND_COMPONENTS}) # Set up the core library and add it to the list of all components -add_library(@LIB_NAME_COMP_PREFIX@::@LIB_NAME_COMP_PREFIX@ ALIAS @LIB_NAME@@LIB_VER_MAJOR@::@LIB_NAME@@LIB_VER_MAJOR@) -add_library(@LIB_NAME_COMP_PREFIX@::core ALIAS @LIB_NAME@@LIB_VER_MAJOR@::@LIB_NAME@@LIB_VER_MAJOR@) +add_library(@LIB_NAME_COMP_PREFIX@::@LIB_NAME_COMP_PREFIX@ ALIAS @LIB_NAME@::@LIB_NAME@) +add_library(@LIB_NAME_COMP_PREFIX@::core ALIAS @LIB_NAME@::@LIB_NAME@) # Retrieve the list of components -get_target_property(components @LIB_NAME@@LIB_VER_MAJOR@::requested INTERFACE_LINK_LIBRARIES) +get_target_property(components @LIB_NAME@::requested INTERFACE_LINK_LIBRARIES) foreach(component ${components}) # Skip the core library - if(${component} STREQUAL @LIB_NAME@@LIB_VER_MAJOR@::@LIB_NAME@@LIB_VER_MAJOR@) + if(${component} STREQUAL @LIB_NAME@::@LIB_NAME@) continue() endif() # Change "gz-libN::gz-libN-component" to "component" - string(REGEX REPLACE "@LIB_NAME@@LIB_VER_MAJOR@::@LIB_NAME@@LIB_VER_MAJOR@-" "" component_name ${component}) + string(REGEX REPLACE "@LIB_NAME@::@LIB_NAME@-" "" component_name ${component}) add_library(@LIB_NAME_COMP_PREFIX@::${component_name} ALIAS ${component}) endforeach() # Add a root gz-lib alias -add_library(@LIB_NAME_COMP_PREFIX@ ALIAS @LIB_NAME@@LIB_VER_MAJOR@::@LIB_NAME@@LIB_VER_MAJOR@) +add_library(@LIB_NAME_COMP_PREFIX@ ALIAS @LIB_NAME@::@LIB_NAME@) diff --git a/gz_math_vendor-extras.cmake.in b/gz_math_vendor-extras.cmake.in deleted file mode 100644 index d490202..0000000 --- a/gz_math_vendor-extras.cmake.in +++ /dev/null @@ -1 +0,0 @@ -list(PREPEND CMAKE_PREFIX_PATH "@CMAKE_INSTALL_PREFIX@/opt/@PROJECT_NAME@/extra_cmake") From 0f2577925f9b567b269438415f095d64fc2e1abf Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 31 Jul 2025 22:17:46 +0000 Subject: [PATCH 2/6] Add option VENDOR_FROM_LIB_VCS_REF This allows vendoring from a specified vcs ref instead of the hard-coded tag. When this option is set to true, a branch, tag, or commit can be specified in the LIB_VCS_REF variable. If LIB_VCS_REF is unspecified, vendoring will use main. Signed-off-by: Steve Peters --- CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 559178d..34186b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,17 @@ set(LIB_NAME_COMP_PREFIX ${LIB_NAME}) set(LIB_NAME_FULL ${LIB_NAME}) set(LIB_VER ${LIB_VER_MAJOR}.${LIB_VER_MINOR}.${LIB_VER_PATCH}) +OPTION(VENDOR_FROM_LIB_VCS_REF + "Vendor from a VCS ref instead of tag. Uses the value in LIB_VCS_REF if specified or main otherwise" + OFF) +if(NOT VENDOR_FROM_LIB_VCS_REF) + set(LIB_VCS_VER ${GITHUB_NAME}${LIB_VER_MAJOR}_${LIB_VER}${LIB_VER_SUFFIX}) +elseif(LIB_VCS_REF) + set(LIB_VCS_VER ${LIB_VCS_REF}) +else() + set(LIB_VCS_VER main) +endif() + find_package(ament_cmake_core REQUIRED) find_package(ament_cmake_vendor_package REQUIRED) find_package(ament_cmake_export_dependencies REQUIRED) @@ -41,7 +52,7 @@ find_package(${LIB_NAME_FULL} ${VERSION_MATCH} ${LIB_VER} COMPONENTS all QUIET) ament_vendor(${LIB_NAME_UNDERSCORE}_vendor SATISFIED ${${LIB_NAME_FULL}_FOUND} VCS_URL https://github.com/gazebosim/${GITHUB_NAME}.git - VCS_VERSION ${GITHUB_NAME}${LIB_VER_MAJOR}_${LIB_VER}${LIB_VER_SUFFIX} + VCS_VERSION ${LIB_VCS_VER} CMAKE_ARGS -DSKIP_PYBIND11:BOOL=ON -DSKIP_SWIG:BOOL=ON From 2fe3ce0a90301ca10ddb45cd987cfef41af40b83 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 1 Aug 2025 18:20:49 +0000 Subject: [PATCH 3/6] remove unused cmake config file Signed-off-by: Steve Peters --- gz-math-config.cmake.in | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 gz-math-config.cmake.in diff --git a/gz-math-config.cmake.in b/gz-math-config.cmake.in deleted file mode 100644 index 74dc46e..0000000 --- a/gz-math-config.cmake.in +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) - -find_package(@LIB_NAME@ ${@LIB_NAME@_FIND_VERSION} REQUIRED COMPONENTS ${@LIB_NAME@_FIND_COMPONENTS}) - -# Set up the core library and add it to the list of all components -add_library(@LIB_NAME_COMP_PREFIX@::@LIB_NAME_COMP_PREFIX@ ALIAS @LIB_NAME@::@LIB_NAME@) -add_library(@LIB_NAME_COMP_PREFIX@::core ALIAS @LIB_NAME@::@LIB_NAME@) - -# Retrieve the list of components -get_target_property(components @LIB_NAME@::requested INTERFACE_LINK_LIBRARIES) - -foreach(component ${components}) - # Skip the core library - if(${component} STREQUAL @LIB_NAME@::@LIB_NAME@) - continue() - endif() - - # Change "gz-libN::gz-libN-component" to "component" - string(REGEX REPLACE "@LIB_NAME@::@LIB_NAME@-" "" component_name ${component}) - add_library(@LIB_NAME_COMP_PREFIX@::${component_name} ALIAS ${component}) -endforeach() - -# Add a root gz-lib alias -add_library(@LIB_NAME_COMP_PREFIX@ ALIAS @LIB_NAME@::@LIB_NAME@) From 6462f1f236d0c5970200208b68ea14359375ff26 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 1 Aug 2025 18:21:06 +0000 Subject: [PATCH 4/6] use lowercase to fix linter complaint Signed-off-by: Steve Peters --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34186b1..42caf99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set(LIB_NAME_COMP_PREFIX ${LIB_NAME}) set(LIB_NAME_FULL ${LIB_NAME}) set(LIB_VER ${LIB_VER_MAJOR}.${LIB_VER_MINOR}.${LIB_VER_PATCH}) -OPTION(VENDOR_FROM_LIB_VCS_REF +option(VENDOR_FROM_LIB_VCS_REF "Vendor from a VCS ref instead of tag. Uses the value in LIB_VCS_REF if specified or main otherwise" OFF) if(NOT VENDOR_FROM_LIB_VCS_REF) From 418c705959e8154d020d076fe7064de20760d233 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 1 Aug 2025 18:21:14 +0000 Subject: [PATCH 5/6] build python bindings Signed-off-by: Steve Peters --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42caf99..a0468e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,6 @@ ament_vendor(${LIB_NAME_UNDERSCORE}_vendor VCS_URL https://github.com/gazebosim/${GITHUB_NAME}.git VCS_VERSION ${LIB_VCS_VER} CMAKE_ARGS - -DSKIP_PYBIND11:BOOL=ON -DSKIP_SWIG:BOOL=ON GLOBAL_HOOK ) From ff3934ae793682bae0c8986dd1641ea996d8dca5 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Thu, 4 Sep 2025 22:47:06 +0000 Subject: [PATCH 6/6] 9.0.0~pre1 Signed-off-by: Steve Peters --- CMakeLists.txt | 4 ++-- package.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a0468e3..376ab73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,14 +6,14 @@ project(gz_math_vendor) set(LIB_VER_MAJOR 9) set(LIB_VER_MINOR 0) set(LIB_VER_PATCH 0) -set(LIB_VER_SUFFIX "") +set(LIB_VER_SUFFIX "-pre1") # Derived variables set(LIB_NAME gz-math) set(GITHUB_NAME gz-math) string(REPLACE "-" "_" LIB_NAME_UNDERSCORE ${LIB_NAME}) set(LIB_NAME_COMP_PREFIX ${LIB_NAME}) -set(LIB_NAME_FULL ${LIB_NAME}) +set(LIB_NAME_FULL gz-math) set(LIB_VER ${LIB_VER_MAJOR}.${LIB_VER_MINOR}.${LIB_VER_PATCH}) option(VENDOR_FROM_LIB_VCS_REF diff --git a/package.xml b/package.xml index 371fb11..f3da42b 100644 --- a/package.xml +++ b/package.xml @@ -12,7 +12,7 @@ --> 0.3.1 - Vendor package for: gz-math8 8.2.0 + Vendor package for: gz-math 9.0.0 Gazebo Math : Math classes and functions for robot applications @@ -33,7 +33,7 @@ gz_utils_vendor - gz-math8 + gz-math ament_cmake_copyright ament_cmake_lint_cmake