From e120287afa964601c7abca46dbfbf3a711b8c9a4 Mon Sep 17 00:00:00 2001 From: DasRoteSkelett Date: Wed, 20 Dec 2023 17:50:40 +0100 Subject: [PATCH] CMakeLists.txt: Some fixes for Relocatable package (#179) 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 Co-authored-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) # --------------------------------