summaryrefslogtreecommitdiffstats
path: root/cmake/QtFindPackageHelpers.cmake
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-03-27 12:47:42 +0200
committerAhmad Samir <a.samirh78@gmail.com>2023-03-28 15:45:24 +0200
commit396e6daea42bf83b68a6850ff2f82cae74c13fc3 (patch)
treec4909cb8f3070632f112f29e24feb59a65094dfb /cmake/QtFindPackageHelpers.cmake
parent80c1406371d10cd8536de988195f00ddbc1c25a2 (diff)
CMake: add some docs for qt_find_package
For -developer-buildS qt_find_package caches which packages were found on the first configuration, to make the build system pick up a newly added qt_find_package call one needs to follow one of the methods that are now mentioned in the docs. Hugely based on commit message from commit 6847a19e3edc76cce6ca0f0c25e520db591cedb9. Change-Id: I4a13d3c97a6172f504a57298c4b3edee30d21250 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtFindPackageHelpers.cmake')
-rw-r--r--cmake/QtFindPackageHelpers.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmake/QtFindPackageHelpers.cmake b/cmake/QtFindPackageHelpers.cmake
index 407e41b833..60550d7a66 100644
--- a/cmake/QtFindPackageHelpers.cmake
+++ b/cmake/QtFindPackageHelpers.cmake
@@ -16,6 +16,15 @@ function(qt_find_package_promote_targets_to_global_scope target)
"qt_find_package_targets_dict" "promote_global")
endfunction()
+# As an optimization when using -developer-build, qt_find_package records which
+# packages were found during the initial configuration. Then on subsequent
+# reconfigurations it skips looking for packages that were not found on the
+# initial run.
+# For the build system to pick up a newly added qt_find_package call, you need to:
+# - Start with a clean build dir
+# - Or remove the <builddir>/CMakeCache.txt file and configure from scratch
+# - Or remove the QT_INTERNAL_PREVIOUSLY_FOUND_PACKAGES cache variable (by
+# editing CMakeCache.txt) and reconfigure.
macro(qt_find_package)
# Get the target names we expect to be provided by the package.
set(find_package_options CONFIG NO_MODULE MODULE REQUIRED)