diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-21 12:22:35 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-23 11:13:21 +0000 |
commit | 6fb9bf453f6f67af42649034af4ec5745e12d901 (patch) | |
tree | e848c277b7c2dac30fa0254051994e7c121ea5c3 /src/plugins/coreplugin | |
parent | 9645687e539bd0ea286fb4136329458c3db3694e (diff) | |
download | qt-creator-6fb9bf453f6f67af42649034af4ec5745e12d901.tar.gz |
CMake build: Add ability to disable building of individual plugins
Adds a cache entry "BUILD_PLUGIN_${NAME}", defaulting to ON which
can be set to OFF to disable building of a plugin.
Adds a extend_qtc_plugin function that should be used to add
properties to a plugin after add_qtc_plugin, instead of the
standard CMake functions target_... . The new function results
in a no-op if the plugin was disabled.
Change-Id: I57f6799620aea0aaa8b56acead4815ccced95911
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r-- | src/plugins/coreplugin/CMakeLists.txt | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/plugins/coreplugin/CMakeLists.txt b/src/plugins/coreplugin/CMakeLists.txt index 1ad00dca76..06eb1213fd 100644 --- a/src/plugins/coreplugin/CMakeLists.txt +++ b/src/plugins/coreplugin/CMakeLists.txt @@ -151,22 +151,29 @@ add_qtc_plugin(Core EXPLICIT_MOC dialogs/filepropertiesdialog.h ) -if (WITH_TESTS) - target_sources(Core PRIVATE +extend_qtc_plugin(Core + CONDITION WITH_TESTS + SOURCES locator/locator_test.cpp locator/locatorfiltertest.cpp locator/locatorfiltertest.h testdatadir.cpp testdatadir.h - ) -endif() +) + +extend_qtc_plugin(Core + CONDITION WIN32 + SOURCES progressmanager/progressmanager_win.cpp +) -if (WIN32) - target_sources(Core PRIVATE progressmanager/progressmanager_win.cpp) -elseif (APPLE) - find_library(FWAppKit AppKit) - target_link_libraries(Core PRIVATE ${FWAppKit}) - target_sources(Core PRIVATE +find_library(FWAppKit AppKit) +extend_qtc_plugin(Core + CONDITION APPLE AND FWAppKit + DEPENDS ${FWAppKit} + SOURCES progressmanager/progressmanager_mac.mm - locator/spotlightlocatorfilter.h locator/spotlightlocatorfilter.mm) -else() - target_sources(Core PRIVATE progressmanager/progressmanager_x11.cpp) -endif() + locator/spotlightlocatorfilter.h locator/spotlightlocatorfilter.mm +) + +extend_qtc_plugin(Core + CONDITION (NOT WIN32) AND (NOT APPLE) + SOURCES progressmanager/progressmanager_x11.cpp +) |