forked from qt-creator/qt-creator
CMake Build: Add option to build plugins, libraries, executables by default
You might want to build only a specific list of plugins, libraries, or executables by opting in, instead of building all of them and opting out. Change-Id: Ic81da380828779e409ba4192f307aa1b77a89808 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Cristian Adam
parent
2fa08db858
commit
0dda86c55b
@@ -29,6 +29,10 @@ list(APPEND DEFAULT_DEFINES
|
||||
RELATIVE_DOC_PATH="${RELATIVE_DOC_PATH}"
|
||||
)
|
||||
|
||||
option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON)
|
||||
option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON)
|
||||
option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON)
|
||||
|
||||
function(qtc_plugin_enabled varName name)
|
||||
if (NOT (name IN_LIST __QTC_PLUGINS))
|
||||
message(FATAL_ERROR "qtc_plugin_enabled: Unknown plugin target \"${name}\"")
|
||||
@@ -79,7 +83,7 @@ function(add_qtc_library name)
|
||||
# special libraries can be turned off
|
||||
if (_arg_BUILD_BY_DEFAULT)
|
||||
string(TOUPPER "BUILD_LIBRARY_${name}" _build_library_var)
|
||||
set(_build_library_default "ON")
|
||||
set(_build_library_default ${BUILD_LIBRARIES_BY_DEFAULT})
|
||||
if (DEFINED ENV{QTC_${_build_library_var}})
|
||||
set(_build_library_default "$ENV{QTC_${_build_library_var}}")
|
||||
endif()
|
||||
@@ -264,7 +268,7 @@ function(add_qtc_plugin target_name)
|
||||
if (DEFINED _arg_BUILD_DEFAULT)
|
||||
set(_build_plugin_default ${_arg_BUILD_DEFAULT})
|
||||
else()
|
||||
set(_build_plugin_default "ON")
|
||||
set(_build_plugin_default ${BUILD_PLUGINS_BY_DEFAULT})
|
||||
endif()
|
||||
if (DEFINED ENV{QTC_${_build_plugin_var}})
|
||||
set(_build_plugin_default "$ENV{QTC_${_build_plugin_var}}")
|
||||
@@ -497,7 +501,7 @@ function(add_qtc_executable name)
|
||||
update_cached_list(__QTC_EXECUTABLES "${name}")
|
||||
|
||||
string(TOUPPER "BUILD_EXECUTABLE_${name}" _build_executable_var)
|
||||
set(_build_executable_default "ON")
|
||||
set(_build_executable_default ${BUILD_EXECUTABLES_BY_DEFAULT})
|
||||
if (DEFINED ENV{QTC_${_build_executable_var}})
|
||||
set(_build_executable_default "$ENV{QTC_${_build_executable_var}}")
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user