From 9e5e98047e55a66e97a9b90997e1bfacb7e835ac Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Fri, 20 Sep 2019 13:37:36 +0200 Subject: [PATCH] Add expansion for QQC2_SOURCE_TREE Test in QtQuickControls2 rely on this variable, which basically points to the root of the project. We can't use PROJECT_SOURCE_DIR since it will vary depending on whether we build tests as stanadlone or part of the build. Change-Id: Ic59a79af2b4b62611d6c32391c936e98e469dea0 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- util/cmake/pro2cmake.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5ef5d85f853..1ddbc966755 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1068,6 +1068,12 @@ class Scope(object): if not is_same_path: relative_path = os.path.relpath(self.currentdir, self.basedir) + if key == "QQC2_SOURCE_TREE": + qmake_conf_path = find_qmake_conf(os.path.abspath(self.currentdir)) + qmake_conf_dir_path = os.path.dirname(qmake_conf_path) + project_relative_path = os.path.relpath(qmake_conf_dir_path, self.currentdir) + return ['${CMAKE_CURRENT_SOURCE_DIR}/'+ project_relative_path] + if key == "_PRO_FILE_PWD_": return ["${CMAKE_CURRENT_SOURCE_DIR}"] if key == "PWD":