Move `qt_internal_project_setup` as early as possible

The earliest we can move this is right after `BuildInternals`. This
allows us to add function calls before navigating the `find_package`
tree of the dependents.

Task-number: QTBUG-135233
Change-Id: I30727fefcfa606528ee11ed5d6def0a24e33e40b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Cristian Le 2025-03-28 16:31:36 +01:00
parent dffc4708aa
commit 353b237c27
1 changed files with 7 additions and 2 deletions

View File

@ -13,10 +13,15 @@ project(QtDeclarative # special case
LANGUAGES CXX C
)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) # special case
find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Network Widgets OpenGL OpenGLWidgets Sql Concurrent Test TestInternalsPrivate LanguageServerPrivate LinguistTools Svg ExamplesAssetDownloaderPrivate)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals)
# This should be called as early as possible, just after find_package(BuildInternals) where it is
# defined.
qt_internal_project_setup()
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED Core)
find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Network Widgets OpenGL OpenGLWidgets Sql Concurrent Test TestInternalsPrivate LanguageServerPrivate LinguistTools Svg ExamplesAssetDownloaderPrivate)
# Set up QT_HOST_PATH as an extra root path to look for the ShaderToolsTools package
# when cross-compiling.
if(NOT "${QT_HOST_PATH}" STREQUAL "")