diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e96196..5f47c9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,19 +3,30 @@ cmake_minimum_required(VERSION 3.10)
project(sdformat_vendor)
# Project-specific settings
-set(LIB_VER_MAJOR 15)
-set(LIB_VER_MINOR 3)
+set(LIB_VER_MAJOR 16)
+set(LIB_VER_MINOR 0)
set(LIB_VER_PATCH 0)
-set(LIB_VER_SUFFIX "")
+set(LIB_VER_SUFFIX "-pre1")
# Derived variables
set(LIB_NAME sdformat)
set(GITHUB_NAME sdformat)
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 sdformat)
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)
@@ -43,9 +54,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}
- CMAKE_ARGS
- -DSKIP_PYBIND11:BOOL=ON
+ VCS_VERSION ${LIB_VCS_VER}
GLOBAL_HOOK
)
@@ -75,39 +84,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 "sdformat_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/package.xml b/package.xml
index 8eb0888..5521fe7 100644
--- a/package.xml
+++ b/package.xml
@@ -12,7 +12,7 @@
-->
0.2.5
- Vendor package for: sdformat15 15.3.0
+ Vendor package for: sdformat 16.0.0
SDFormat is an XML file format that describes environments, objects, and robots
in a manner suitable for robotic applications
@@ -41,7 +41,7 @@ in a manner suitable for robotic applications
gz_tools_vendor
- sdformat15
+ sdformat
ament_cmake_copyright
ament_cmake_lint_cmake
diff --git a/sdformat-config.cmake.in b/sdformat-config.cmake.in
deleted file mode 100644
index 56d06dd..0000000
--- a/sdformat-config.cmake.in
+++ /dev/null
@@ -1,24 +0,0 @@
-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})
-
-# 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@)
-
-# Retrieve the list of components
-get_target_property(components @LIB_NAME@@LIB_VER_MAJOR@::requested INTERFACE_LINK_LIBRARIES)
-
-foreach(component ${components})
- # Skip the core library
- if(${component} STREQUAL @LIB_NAME@@LIB_VER_MAJOR@::@LIB_NAME@@LIB_VER_MAJOR@)
- 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})
- 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@)
diff --git a/sdformat_vendor-extras.cmake.in b/sdformat_vendor-extras.cmake.in
deleted file mode 100644
index d490202..0000000
--- a/sdformat_vendor-extras.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-list(PREPEND CMAKE_PREFIX_PATH "@CMAKE_INSTALL_PREFIX@/opt/@PROJECT_NAME@/extra_cmake")