summaryrefslogtreecommitdiffstats
path: root/cmake/QtPostProcess.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-05-15 14:22:20 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-05-15 17:34:05 +0000
commit4dacc099213acf804b50c6e9a9afba5fda8b8e3b (patch)
tree028c33fbf70725095bd12fceb0446bdeb6dc6d13 /cmake/QtPostProcess.cmake
parent9542e78525b422159406d8fa63e30dcd0f926411 (diff)
Save and set the CMAKE_INSTALL_PREFIX in BuildInternal's Config file
Once qtbase is built and installed, save the CMAKE_INSTALL_PREFIX that was used during the build, and set it when a consumer calls find_package(Qt5BuildInternals). This fixes a bug where syncqt can not be found when building qtsvg, while the developer specifies CMAKE_PREFIX_PATH to find the Qt packages, but does not set the CMAKE_INSTALL_PREFIX. Task-number: QTBUG-75544 Change-Id: I03fd23ba418af5115105610f3f9ed92664562945 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtPostProcess.cmake')
-rw-r--r--cmake/QtPostProcess.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake
index d900f8e88f..b1fb07c394 100644
--- a/cmake/QtPostProcess.cmake
+++ b/cmake/QtPostProcess.cmake
@@ -176,6 +176,12 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE "
set(QT_BUILD_INTERNALS_PATH \"\${CMAKE_CURRENT_LIST_DIR}\")")
+ # Propagate the original install prefix, so that a developer building a child module can
+ # specify CMAKE_PREFIX_PATH for finding the Qt modules instead of CMAKE_INSTALL_PREFIX.
+ string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE "
+set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH
+\"Install path prefix, prepended onto install directories.\" FORCE)")
+
# Propagate developer builds to other modules via BuildInternals package.
if(FEATURE_developer_build)
string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE "