Include QtPlatformSupport as part of find_package(Qt6BuildInternals)
This is needed because the ported over requires() clauses from qmake to CMake are executed before qt_repo_build(), which means that all the custom platform variables that we set (like LINUX, APPLE_OSX) need to be available immediately after finding BuildInternals. Change-Id: I7345b69edf72c266508846766e64f42c99862d1d Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
992fe06b30
commit
981cfe7d79
@ -18,12 +18,13 @@ list(PREPEND CMAKE_MODULE_PATH
|
|||||||
)
|
)
|
||||||
|
|
||||||
## Find the build internals package.
|
## Find the build internals package.
|
||||||
|
set(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION TRUE)
|
||||||
list(PREPEND CMAKE_PREFIX_PATH
|
list(PREPEND CMAKE_PREFIX_PATH
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||||
)
|
)
|
||||||
find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
|
find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
|
||||||
|
unset(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
|
||||||
qt_build_repo_begin(SKIP_CMAKE_MODULE_PATH_ADDITION)
|
qt_build_repo_begin()
|
||||||
|
|
||||||
## QtBase specific configure tests:
|
## QtBase specific configure tests:
|
||||||
include(QtBaseConfigureTests)
|
include(QtBaseConfigureTests)
|
||||||
|
@ -13,7 +13,7 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
macro(qt_set_up_build_internals_paths)
|
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
|
# least important compared to the source dir ones, but more important than command line
|
||||||
# provided ones.
|
# provided ones.
|
||||||
set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}")
|
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()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(qt_build_repo_begin)
|
# Set up the build internal paths unless explicitly requested not to.
|
||||||
if(${ARGC} EQUAL 1 AND "${ARGV0}" STREQUAL "SKIP_CMAKE_MODULE_PATH_ADDITION")
|
if(NOT QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
|
||||||
# No-op.
|
|
||||||
else()
|
|
||||||
qt_set_up_build_internals_paths()
|
qt_set_up_build_internals_paths()
|
||||||
endif()
|
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:
|
# Qt specific setup common for all modules:
|
||||||
include(QtSetup)
|
include(QtSetup)
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
|
@ -90,9 +90,6 @@ enable_testing()
|
|||||||
# Set up building of examples.
|
# Set up building of examples.
|
||||||
option(BUILD_EXAMPLES "Build Qt examples" ON)
|
option(BUILD_EXAMPLES "Build Qt examples" ON)
|
||||||
|
|
||||||
## Define some constants to check for certain platforms, etc:
|
|
||||||
include(QtPlatformSupport)
|
|
||||||
|
|
||||||
## Android platform settings
|
## Android platform settings
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
include(QtPlatformAndroid)
|
include(QtPlatformAndroid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user