diff --git a/CMakeLists.txt b/CMakeLists.txt index bb025a4d..9e357867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ write_basic_package_version_file( configure_package_config_file("${cmake_conf_file}.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}.cmake" INSTALL_DESTINATION ${CMAKE_CONFIG_INSTALL_DIR} + PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${cmake_conf_file}.cmake" diff --git a/cmake/urdfdom-config.cmake.in b/cmake/urdfdom-config.cmake.in index 2905cdfa..6a2667b3 100644 --- a/cmake/urdfdom-config.cmake.in +++ b/cmake/urdfdom-config.cmake.in @@ -8,16 +8,16 @@ set(@PKG_NAME@_CONFIG_INCLUDED TRUE) set(CMAKE_MODULE_PATH_BACKUP_URDFDOM ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH "${@PROJECT_NAME@_DIR}") -set(@PKG_NAME@_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") +set(@PKG_NAME@_INCLUDE_DIRS "@PACKAGE_INSTALL_INCLUDEDIR@") foreach(lib @PKG_LIBRARIES@) set(onelib "${lib}-NOTFOUND") set(onelibd "${lib}-NOTFOUND") find_library(onelib ${lib} - PATHS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@" + PATHS "@PACKAGE_INSTALL_LIBDIR@" NO_DEFAULT_PATH) find_library(onelibd ${lib}d - PATHS "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@" + PATHS "@PACKAGE_INSTALL_LIBDIR@" NO_DEFAULT_PATH) if(onelib-NOTFOUND AND onelibd-NOTFOUND) message(FATAL_ERROR "Library '${lib}' in package @PKG_NAME@ is not installed properly")