summaryrefslogtreecommitdiffstats
path: root/cmake/QtFindWrapConfigExtra.cmake.in
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-05 13:15:34 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-05 16:08:14 +0100
commit4f7cc722985fb52ea67f56dfb766bb274410ba2d (patch)
treed2a96bb9091c94aaed5e0cc7b9d408e26c71ec09 /cmake/QtFindWrapConfigExtra.cmake.in
parenta2305f94306013a0273b276955b3b2340a06a9e6 (diff)
CMake: Handle conditions in third party find modules correctly
Previously the FindWrap modules checked for hardcoded features when deciding whether to use a bundled library or not. This proved not to work correctly because features were not available when the find modules were processed. Introduce a new CMake API call that needs to be manually called after an add_subdirectory call which declares a bundled library. The call will check for the existence of the bundled target, and will then set a cache variable QT_USE_BUNDLED_Bundled<TargetName>. The same variable is written into a FindWrapFooConfigExtra.cmake file which will be loaded by the appropriate FindWrap module. The module can that use that variable to decided whether to link against the bundled library or the system library. Change-Id: I75e9a4f4e14d88d4490916a79ad12f1ce57891e0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtFindWrapConfigExtra.cmake.in')
-rw-r--r--cmake/QtFindWrapConfigExtra.cmake.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/QtFindWrapConfigExtra.cmake.in b/cmake/QtFindWrapConfigExtra.cmake.in
new file mode 100644
index 0000000000..6ecf43512c
--- /dev/null
+++ b/cmake/QtFindWrapConfigExtra.cmake.in
@@ -0,0 +1 @@
+@extra_cmake_code@