diff options
Diffstat (limited to 'cmake')
3 files changed, 12 insertions, 2 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 76e93ae990..3a817de083 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -230,11 +230,20 @@ if(NOT QT_BUILD_INTERNALS_SKIP_SYSTEM_PREFIX_ADJUSTMENT) qt_build_internals_set_up_system_prefixes() endif() -macro(qt_build_internals_set_up_private_api) +# The macro sets all the necessary pre-conditions and setup consistent environment for building +# the Qt repository. It has to be called right after the find_package(Qt6 COMPONENTS BuildInternals) +# call. Otherwise we cannot make sure that all the required policies will be applied to the Qt +# components that are involved in build procedure. +macro(qt_internal_project_setup) # Check for the minimum CMake version. include(QtCMakeVersionHelpers) qt_internal_require_suitable_cmake_version() qt_internal_upgrade_cmake_policies() +endmacro() + +macro(qt_build_internals_set_up_private_api) + # TODO: this call needs to be removed once all repositories got the qtbase update + qt_internal_project_setup() # Qt specific setup common for all modules: include(QtSetup) diff --git a/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/CMakeLists.txt b/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/CMakeLists.txt index 3de43f5885..09c4dad4bb 100644 --- a/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/CMakeLists.txt +++ b/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/CMakeLists.txt @@ -6,7 +6,7 @@ project(qt_single_test VERSION 6.0.0 LANGUAGES C CXX ASM) find_package(Qt6 REQUIRED COMPONENTS BuildInternals Core) -include(${CMAKE_CURRENT_LIST_DIR}/Main.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/Main.cmake NO_POLICY_SCOPE) # Get the absolute path of the passed-in project dir, relative to the current working directory # of the calling script, rather than relative to this source directory. diff --git a/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/Main.cmake b/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/Main.cmake index 89bb2a1132..c7222c8b71 100644 --- a/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/Main.cmake +++ b/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/Main.cmake @@ -2,6 +2,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Includes QtSetup and friends for private CMake API. +qt_internal_project_setup() qt_build_internals_set_up_private_api() # Find all StandaloneTestsConfig.cmake files, and include them |