diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-11-04 16:46:11 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-11-05 15:11:39 +0000 |
commit | d24c34c7472c5a5cd0ee80597dfb41a7535849ee (patch) | |
tree | 0a9a3a3d8f4ea5dda6640f2b093f2e5925049d8b /cmake | |
parent | 4035fc24331c0c7ffd28542dc2d2d73745a26033 (diff) |
cmake build: Disable refactoringbackend and pchmanagerbackend
Disable the libs and executables if not needed by either the plugins or
by the tests.
So far in the cmake build the ClangRefactoring and ClangPchManager
plugins were disabled by default, but the backend executables were still
built. With this change the executables are not built if the plugins are
not enabled, like it is the case in the qmake build.
To make it possible to build all the tests even though the plugins are
disabled by default, the backend libraries are still built if tests are
enabled.
Change-Id: I3b61479525e1472a55215f1b003fea9facaf9e93
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtCreatorAPI.cmake | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index d7a2a1081e..0221248fae 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -546,10 +546,10 @@ endfunction() function(add_qtc_executable name) cmake_parse_arguments(_arg "SKIP_INSTALL;SKIP_TRANSLATION;ALLOW_ASCII_CASTS" - "DESTINATION;COMPONENT" - "DEPENDS;DEFINES;INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PROPERTIES" ${ARGN}) + "DESTINATION;COMPONENT;BUILD_DEFAULT" + "CONDITION;DEPENDS;DEFINES;INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PROPERTIES" ${ARGN}) - if ($_arg_UNPARSED_ARGUMENTS) + if (${_arg_UNPARSED_ARGUMENTS}) message(FATAL_ERROR "add_qtc_executable had unparsed arguments!") endif() @@ -560,14 +560,27 @@ function(add_qtc_executable name) update_cached_list(__QTC_EXECUTABLES "${name}") + if (NOT _arg_CONDITION) + set(_arg_CONDITION ON) + endif() + string(TOUPPER "BUILD_EXECUTABLE_${name}" _build_executable_var) - set(_build_executable_default ${BUILD_EXECUTABLES_BY_DEFAULT}) + if (DEFINED _arg_BUILD_DEFAULT) + set(_build_executable_default ${_arg_BUILD_DEFAULT}) + else() + set(_build_executable_default ${BUILD_EXECUTABLES_BY_DEFAULT}) + endif() if (DEFINED ENV{QTC_${_build_executable_var}}) set(_build_executable_default "$ENV{QTC_${_build_executable_var}}") endif() set(${_build_executable_var} "${_build_executable_default}" CACHE BOOL "Build executable ${name}.") - if (NOT ${_build_executable_var}) + if ((${_arg_CONDITION}) AND ${_build_executable_var}) + set(_executable_enabled ON) + else() + set(_executable_enabled OFF) + endif() + if (NOT _executable_enabled) return() endif() |