From b8de42201403fc6a1115e7293ea8a7b0181a6e46 Mon Sep 17 00:00:00 2001 From: Matthias Schoepfer Date: Sat, 11 Feb 2023 11:07:22 +0100 Subject: [PATCH] CMakeLists.txt: Some fixes for Relocatable package There are some absolute path in the generation of the .cmake files which ruin the creation of relocatable packages. Fixing: * CMAKE_MODULE_PATH append instead of replacement * INTERFACE use relative path instead of ${CMAKE_INSTALL_INCLUDEDIR} See also https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html#creating-relocatable-packages for reference. Signed-off-by: Matthias Schoepfer --- CMakeLists.txt | 2 +- urdf_parser/CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20812842..ae031354 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ if(MSVC OR MSVC90 OR MSVC10) set(MSVC ON) endif (MSVC OR MSVC90 OR MSVC10) -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") find_package(tinyxml2_vendor QUIET) find_package(TinyXML2 REQUIRED) diff --git a/urdf_parser/CMakeLists.txt b/urdf_parser/CMakeLists.txt index a375f1fd..20a6a050 100644 --- a/urdf_parser/CMakeLists.txt +++ b/urdf_parser/CMakeLists.txt @@ -75,9 +75,9 @@ target_include_directories(urdf_parser INTERFACE "$" "$") target_link_libraries(urdf_parser INTERFACE - urdfdom_model - urdfdom_sensor - urdfdom_world) + urdfdom::urdfdom_model + urdfdom::urdfdom_sensor + urdfdom::urdfdom_world) # --------------------------------