diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-23 13:40:53 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-24 07:13:43 +0000 |
commit | d987c3ba676455f9461da6c479da9fcc9bcf1b2b (patch) | |
tree | ae8594e04012fb68509dc80471742f34c3161c8b /src/CMakeLists.txt | |
parent | 25adc78f6dfbc7ff8cfaf9bda16cecb663618c5e (diff) |
CMake build: Read QTC_BUILD_PLUGIN_${NAME} environment as default
for BUILD_PLUGIN_${NAME}. This is only used as the default for the CMake
cache, so only if you haven't run CMake before.
The disadvantage is that just changing the environment variable after
the fact will not change anything.
The advantage is that the CMake cache keeps reflecting the actual state,
which is great for ccmake, the UI in Qt Creator, and other configuration
tools.
Change-Id: I25448270c29afa31d240072f58f981b8776597f2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a889baa369..f8bbda9927 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -235,7 +235,11 @@ function(add_qtc_plugin target_name) endif() string(TOUPPER "BUILD_PLUGIN_${target_name}" _build_plugin_var) - set(${_build_plugin_var} "ON" CACHE BOOL "Build plugin ${name}.") + set(_build_plugin_default "ON") + if (DEFINED ENV{QTC_${_build_plugin_var}}) + set(_build_plugin_default "$ENV{QTC_${_build_plugin_var}}") + endif() + set(${_build_plugin_var} "${_build_plugin_default}" CACHE BOOL "Build plugin ${name}.") if ((${_arg_CONDITION}) AND ${_build_plugin_var}) set(_plugin_enabled ON) |