summaryrefslogtreecommitdiffstats
path: root/cmake/QtPostProcess.cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-09-05 17:16:31 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-09-05 17:25:07 +0000
commit9c1b7802d7f118b55ccc04dab74e1ee19e6d429f (patch)
treeb44e3da228156a8ee354e9bc5b276e58e91fa2c1 /cmake/QtPostProcess.cmake
parentbc54f0b16481ec7e6767928c2ae7e79f904440d0 (diff)
Avoid unnecessary find_package calls when using Qt with shared builds
Don't create the plugin config files when doing shared builds, otherwise for example Qt6GuiPlugins.cmake will try to include the xcb plugin cmake config, which in turn will perform a full-fledged find_package series to locate xcb. When an application just uses find_package(Qt6Gui), then that is not needed. Change-Id: I1890aaa5be8e214151c65fa981f547a73c0ca7fc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'cmake/QtPostProcess.cmake')
-rw-r--r--cmake/QtPostProcess.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake
index 8a09efe35a..880e73e869 100644
--- a/cmake/QtPostProcess.cmake
+++ b/cmake/QtPostProcess.cmake
@@ -267,6 +267,11 @@ endfunction()
# This function creates the Qt<Module>Plugins.cmake used to list all
# the plug-in target files.
function(qt_internal_create_plugins_files)
+ # The plugins cmake configuration is only needed for static builds. Dynamic builds don't need
+ # the application to link against plugins at build time.
+ if(NOT QT_BUILD_SHARED_LIBS)
+ return()
+ endif()
qt_internal_get_qt_repo_known_modules(repo_known_modules)
message("Generating Plugins files for ${repo_known_modules}...")