Skip to content

Commit

Permalink
config.cmake: avoid using ${PACKAGE_PREFIX_DIR} directly
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Feb 29, 2024
1 parent 1babbf6 commit a259e31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions cmake/urdfdom-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a259e31

Please sign in to comment.