summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake18
-rw-r--r--cmake/QtSetup.cmake3
3 files changed, 14 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b7803da43..190a39a859 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,12 +18,13 @@ list(PREPEND CMAKE_MODULE_PATH
)
## Find the build internals package.
+set(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION TRUE)
list(PREPEND CMAKE_PREFIX_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
-
-qt_build_repo_begin(SKIP_CMAKE_MODULE_PATH_ADDITION)
+unset(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
+qt_build_repo_begin()
## QtBase specific configure tests:
include(QtBaseConfigureTests)
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 6fffcaba9d..4bf09e5b15 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -13,7 +13,7 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake")
endif()
macro(qt_set_up_build_internals_paths)
- # Set up the paths for the cmake modules located in the build dir. Prepend, so the paths are
+ # Set up the paths for the cmake modules located in the prefix dir. Prepend, so the paths are
# least important compared to the source dir ones, but more important than command line
# provided ones.
set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}")
@@ -39,13 +39,17 @@ macro(qt_set_up_build_internals_paths)
endif()
endmacro()
-macro(qt_build_repo_begin)
- if(${ARGC} EQUAL 1 AND "${ARGV0}" STREQUAL "SKIP_CMAKE_MODULE_PATH_ADDITION")
- # No-op.
- else()
- qt_set_up_build_internals_paths()
- endif()
+# Set up the build internal paths unless explicitly requested not to.
+if(NOT QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
+ qt_set_up_build_internals_paths()
+endif()
+
+# Define some constants to check for certain platforms, etc.
+# Needs to be loaded before qt_repo_build() to handle require() clauses before even starting a repo
+# build.
+include(QtPlatformSupport)
+macro(qt_build_repo_begin)
# Qt specific setup common for all modules:
include(QtSetup)
include(FeatureSummary)
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 9095db4751..16fd9b7520 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -90,9 +90,6 @@ enable_testing()
# Set up building of examples.
option(BUILD_EXAMPLES "Build Qt examples" ON)
-## Define some constants to check for certain platforms, etc:
-include(QtPlatformSupport)
-
## Android platform settings
if(ANDROID)
include(QtPlatformAndroid)