summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Le <[email protected]>2025-03-28 17:07:52 +0100
committerCristian Le <[email protected]>2025-05-30 12:29:32 +0200
commit5f1ed8da0eca3d2faeff6cde4da031b61f231dee (patch)
treedbfb0b0ded9fcce4fedab6beff8167b29bdd860e
parent36910557000f286ebf943f1adef21a678ba53da1 (diff)
Move `qt_internal_project_setup` as early as possibleHEADdev
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: I6a875982fa6d8b15dcfacfda5e4d5976d02798d6 Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 073d55c8..a2b7fa3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,14 @@ project(QtGrpc
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
-find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
+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)
+
# Try to find Qt6::qtprotobufgen and Qt6::qtgrpcgen targets from host tools
# when cross-compiling.
if(NOT "${QT_HOST_PATH}" STREQUAL "")
@@ -22,7 +29,6 @@ endif()
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS Network Gui Widgets Quick
QmlNetwork QuickControls2 QuickTest)
-qt_internal_project_setup()
include("${CMAKE_CURRENT_LIST_DIR}/src/tools/qtprotobufgen/Qt6ProtobufToolsMacros.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/src/tools/qtgrpcgen/Qt6GrpcToolsMacros.cmake")