Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade from tinyxml to tinyxml2 #186

Merged
merged 13 commits into from
Dec 6, 2023
Merged
Prev Previous commit
Next Next commit
Fix generation of CMake config files.
Use the provided CMake primitives for this, which should
make it work in all situations.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
clalancette committed Nov 29, 2023
commit b592bbdb1b3383a8478dec40f368b4f8276381a4
21 changes: 17 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -73,11 +73,24 @@ set(PKG_NAME ${PROJECT_NAME})
set(PKG_LIBRARIES urdfdom_sensor urdfdom_model_state urdfdom_model urdfdom_world)
set(PKG_DEPENDS TinyXML2 urdfdom_headers console_bridge)
set(PKG_EXPORTS urdfdom)
set(cmake_conf_file "cmake/urdfdom-config.cmake")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${cmake_conf_file}.in" "${CMAKE_BINARY_DIR}/${cmake_conf_file}" @ONLY)
set(cmake_conf_file "cmake/urdfdom-config")
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}Version.cmake"
VERSION ${URDF_VERSION}
COMPATIBILITY SameMajorVersion
)
configure_package_config_file("${cmake_conf_file}.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}.cmake"
INSTALL_DESTINATION ${CMAKE_CONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}Version.cmake"
DESTINATION ${CMAKE_CONFIG_INSTALL_DIR}
)

install(FILES package.xml DESTINATION share/${PROJECT_NAME})
install(FILES ${CMAKE_BINARY_DIR}/${cmake_conf_file}
DESTINATION ${CMAKE_CONFIG_INSTALL_DIR} COMPONENT cmake)

# Make the package config file
set(PKG_DESC "Unified Robot Description Format")
2 changes: 2 additions & 0 deletions cmake/urdfdom-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@PACKAGE_INIT@

if (@PKG_NAME@_CONFIG_INCLUDED)
return()
endif()