From 5d88ba001ed44e21ae3456de2ce4d00eaac31e0c Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Mon, 5 Aug 2019 13:51:25 +0200 Subject: [PATCH] Fix $$_PRO_FILE_PWD substitution PRO_FILE_PWD should return CMAKE_CURRENT_SOURCE dir without any compenstation for mistmatching directory locations as we are doing with PWD. There are test that use a shared .pri project file which gets included into the .pro file of test. In this .pri file we have a statement such as DEFINES += QT_QMLTEST_DATADIR=\\\"$${_PRO_FILE_PWD_}/data\\\". Since the .pri project file is located in ../../shared/shared.pri the substitution would result in ${CMAKE_CURRENT_SOURCE_DIR}/../../shared/data instead of the expected ${CMAKE_CURRENT_SOURCE_DIR}/data. Change-Id: Id899d6a624acc45425af47ca9aa1b332cf63e659 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 8eafaff0f88..83bca8487a7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -645,7 +645,9 @@ class Scope(object): is_same_path = self.currentdir == self.basedir - if key == '_PRO_FILE_PWD_' or key == 'PWD': + if key == '_PRO_FILE_PWD_': + return ['${CMAKE_CURRENT_SOURCE_DIR}'] + if key == 'PWD': if is_same_path: return ['${CMAKE_CURRENT_SOURCE_DIR}'] else: