From 34b54bfa025b420023a3c316aa53245cb7994638 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 30 Apr 2020 12:00:08 -0700 Subject: [PATCH] avoid exporting absolute path Signed-off-by: Dirk Thomas --- CMakeLists.txt | 3 ++- cmake/urdfdom_headers-config.cmake.in | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ff6343..9a651cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,9 @@ add_subdirectory(urdf_exception) if(WIN32 AND NOT CYGWIN) set(CMAKE_CONFIG_INSTALL_DIR CMake) else() - set(CMAKE_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_FULL_LIBDIR}/${PROJECT_NAME}/cmake/) + set(CMAKE_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake) endif() +string(REGEX REPLACE "[^/]+" ".." RELATIVE_PATH_CMAKE_DIR_TO_PREFIX "${CMAKE_CONFIG_INSTALL_DIR}") set(PACKAGE_NAME ${PROJECT_NAME}) set(cmake_conf_file "${PROJECT_NAME}-config.cmake") diff --git a/cmake/urdfdom_headers-config.cmake.in b/cmake/urdfdom_headers-config.cmake.in index 74a0db6..e3ec895 100644 --- a/cmake/urdfdom_headers-config.cmake.in +++ b/cmake/urdfdom_headers-config.cmake.in @@ -3,4 +3,4 @@ if (@PACKAGE_NAME@_CONFIG_INCLUDED) endif() set(@PACKAGE_NAME@_CONFIG_INCLUDED TRUE) -set(@PACKAGE_NAME@_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") +set(@PACKAGE_NAME@_INCLUDE_DIRS "${@PROJECT_NAME@_DIR}/@RELATIVE_PATH_CMAKE_DIR_TO_PREFIX@/include")