Skip to content

Commit

Permalink
CMakeLists.txt: Some fixes for Relocatable package (#179)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Matthias Schoepfer <[email protected]>
  • Loading branch information
DasRoteSkelett and Matthias Schoepfer authored Dec 20, 2023
1 parent fb7f8cb commit e120287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions urdf_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ target_include_directories(urdf_parser INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(urdf_parser INTERFACE
urdfdom_model
urdfdom_sensor
urdfdom_world)
urdfdom::urdfdom_model
urdfdom::urdfdom_sensor
urdfdom::urdfdom_world)

# --------------------------------

Expand Down

0 comments on commit e120287

Please sign in to comment.