aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMGeneratePriFile.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2020-05-08 11:58:13 +0200
committerDavid Faure <faure@kde.org>2020-05-08 13:01:03 +0200
commitbac7608540ef894d23b792a973fa6ce597d9b632 (patch)
treebc1765876d67b98b655e032f6218a23bd81edd46 /modules/ECMGeneratePriFile.cmake
parent856fc410bf5337295d0ff1bcb9b746d2b7811fc4 (diff)
downloadextra-cmake-modules-bac7608540ef894d23b792a973fa6ce597d9b632.tar.gz
extra-cmake-modules-bac7608540ef894d23b792a973fa6ce597d9b632.tar.bz2
ECMGeneratePriFile: fix for ECM_MKSPECS_INSTALL_DIR being absolute
Test Plan: works as before for the case where it's relative. Reviewers: cgiboudeaux, vatra, kfunk, apol, vkrause Reviewed By: cgiboudeaux Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D29524
Diffstat (limited to 'modules/ECMGeneratePriFile.cmake')
-rw-r--r--modules/ECMGeneratePriFile.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/ECMGeneratePriFile.cmake b/modules/ECMGeneratePriFile.cmake
index 4f893639..f17d1293 100644
--- a/modules/ECMGeneratePriFile.cmake
+++ b/modules/ECMGeneratePriFile.cmake
@@ -161,7 +161,12 @@ function(ECM_GENERATE_PRI_FILE)
# Prepare the right number of "../.." to go from ECM_MKSPECS_INSTALL_DIR to the install prefix
# This allows to make the generated pri files relocatable (no absolute paths)
- string(REGEX REPLACE "[^/]+" ".." PRI_ROOT_RELATIVE_TO_MKSPECS ${ECM_MKSPECS_INSTALL_DIR})
+ if (IS_ABSOLUTE ${ECM_MKSPECS_INSTALL_DIR})
+ set(BASEPATH ${CMAKE_INSTALL_PREFIX})
+ else()
+ string(REGEX REPLACE "[^/]+" ".." PRI_ROOT_RELATIVE_TO_MKSPECS ${ECM_MKSPECS_INSTALL_DIR})
+ set(BASEPATH "$$PWD/${PRI_ROOT_RELATIVE_TO_MKSPECS}")
+ endif()
set(PRI_TARGET_BASENAME ${EGPF_BASE_NAME})
set(PRI_TARGET_LIBNAME ${EGPF_LIB_NAME})
@@ -169,12 +174,12 @@ function(ECM_GENERATE_PRI_FILE)
if(IS_ABSOLUTE "${EGPF_INCLUDE_INSTALL_DIR}")
set(PRI_TARGET_INCLUDES "${EGPF_INCLUDE_INSTALL_DIR}")
else()
- set(PRI_TARGET_INCLUDES "$$PWD/${PRI_ROOT_RELATIVE_TO_MKSPECS}/${EGPF_INCLUDE_INSTALL_DIR}")
+ set(PRI_TARGET_INCLUDES "${BASEPATH}/${EGPF_INCLUDE_INSTALL_DIR}")
endif()
if(IS_ABSOLUTE "${EGPF_LIB_INSTALL_DIR}")
set(PRI_TARGET_LIBS "${EGPF_LIB_INSTALL_DIR}")
else()
- set(PRI_TARGET_LIBS "$$PWD/${PRI_ROOT_RELATIVE_TO_MKSPECS}/${EGPF_LIB_INSTALL_DIR}")
+ set(PRI_TARGET_LIBS "${BASEPATH}/${EGPF_LIB_INSTALL_DIR}")
endif()
set(PRI_TARGET_DEFINES "")