summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuildInternals
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-19 19:34:53 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-22 23:32:23 +0000
commitdf9c7456d11dfcf74c7399ba0981a3ba3d3f5117 (patch)
tree6b0ef5c7a5e267e804b55ab45ff09cc42ce5c840 /cmake/QtBuildInternals
parent4fed50f4ab8fa6331e2f4d1d0567dcc961e7bb01 (diff)
CMake: Add convenience custom targets to build Qt plugins
Add 3 new convenience custom targets: 'qt_plugins', 'qpa_plugins' and 'qpa_default_plugins'. Additionally, if we detect that an internal executable / test links against Gui, add a dependency on the 'qpa_default_plugins' custom target, so that if a developer configures Qt for the first time and then calls ninja 'tst_foo_check', we ensure the test will launch successfully because the default QPA plugin will also be built. Change-Id: If6dd70844b5effdf8a293f65f8785855cc85b132 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuildInternals')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 84273b5e9e..246ee3b17b 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -235,6 +235,16 @@ macro(qt_build_repo_begin)
add_custom_target(install_docs_docs)
endif()
+ # Add global qt_plugins, qpa_plugins and qpa_default_plugins convenience custom targets.
+ # Internal executables will add a dependency on the qpa_default_plugins target,
+ # so that building and running a test ensures it won't fail at runtime due to a missing qpa
+ # plugin.
+ if(NOT TARGET qt_plugins)
+ add_custom_target(qt_plugins)
+ add_custom_target(qpa_plugins)
+ add_custom_target(qpa_default_plugins)
+ endif()
+
string(TOLOWER ${PROJECT_NAME} project_name_lower)
set(qt_docs_target_name docs_${project_name_lower})