From 6fb9bf453f6f67af42649034af4ec5745e12d901 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 21 May 2019 12:22:35 +0200 Subject: 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 Reviewed-by: Alessandro Portale --- src/plugins/designer/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/plugins/designer') diff --git a/src/plugins/designer/CMakeLists.txt b/src/plugins/designer/CMakeLists.txt index 52f7b53e18..d51c0ccf3e 100644 --- a/src/plugins/designer/CMakeLists.txt +++ b/src/plugins/designer/CMakeLists.txt @@ -36,6 +36,7 @@ add_qtc_plugin(Designer settingspage.cpp settingspage.h ) -if (WITH_TESTS) - target_sources(Designer PRIVATE gotoslot_test.cpp) -endif() +extend_qtc_plugin(Designer + CONDITION WITH_TESTS AND TARGET Qt5::DesignerComponents AND TARGET Qt5::Designer + SOURCES gotoslot_test.cpp +) -- cgit v1.2.3