summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtPostProcess.cmake6
-rw-r--r--cmake/QtSetup.cmake4
2 files changed, 8 insertions, 2 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 "
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 187f1bf740..3b02633ed7 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -41,8 +41,8 @@ if(FEATURE_developer_build)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH
"Install path prefix, prepended onto install directories." FORCE)
else()
- # No-op. While building another module, the CMAKE_INSTALL_PREFIX should be set on the
- # command line to point to the qtbase build dir.
+ # No-op. While building another module, the CMAKE_INSTALL_PREFIX or CMAKE_PREFIX_PATH
+ # (either work) should be set on the command line to point to the qtbase build dir.
endif()
else()
set(QT_WILL_INSTALL ON)