From 1ef5ce278d9eaa44f8f244ce94b716a5094eca0e Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 12 Apr 2024 12:20:57 +0200 Subject: [PATCH] config: find-external: fix for absolute CMAKE_INSTALL_LIBDIR --- package-config.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package-config.cmake b/package-config.cmake index d7134c191..7d8e8da41 100644 --- a/package-config.cmake +++ b/package-config.cmake @@ -91,9 +91,12 @@ macro(ADD_PROJECT_DEPENDENCY) set(_ext "find-external/${PARSED_ARGN_FIND_EXTERNAL}") set(CMAKE_MODULE_PATH "${PROJECT_JRL_CMAKE_MODULE_DIR}/${_ext}" ${CMAKE_MODULE_PATH}) + set(_ext_path "${CONFIG_INSTALL_DIR}/${_ext}") + if(NOT IS_ABSOLUTE ${_ext_path}) + set(_ext_path "\${PACKAGE_PREFIX_DIR}/${_ext_path}") + endif() set(_PACKAGE_CONFIG_DEPENDENCIES_FIND_EXTERNAL - "${_PACKAGE_CONFIG_DEPENDENCIES_FIND_EXTERNAL}\n \${PACKAGE_PREFIX_DIR}/${CONFIG_INSTALL_DIR}/${_ext}" - ) + "${_PACKAGE_CONFIG_DEPENDENCIES_FIND_EXTERNAL}\n ${_ext_path}") install(DIRECTORY "${PROJECT_JRL_CMAKE_MODULE_DIR}/${_ext}" DESTINATION "${CONFIG_INSTALL_DIR}/find-external") endif()