From a0a46333083e47837a11e248efae04d8e206059d Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Fri, 20 Jun 2025 12:44:00 +0200 Subject: [PATCH] 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: I2ee7bb0cb5addc422405768ba5706607a7257d6f Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d75a27b..00b8ab8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,14 @@ project(QtMqtt LANGUAGES CXX C ) -find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core Network) -find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick # For tests - Gui Widgets WebSockets) # For examples +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 COMPONENTS Core Network) +find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Quick # For tests + Gui Widgets WebSockets) # For examples + qt_build_repo()