forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -235,7 +235,11 @@ function(add_qtc_plugin target_name)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
string(TOUPPER "BUILD_PLUGIN_${target_name}" _build_plugin_var)
|
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})
|
if ((${_arg_CONDITION}) AND ${_build_plugin_var})
|
||||||
set(_plugin_enabled ON)
|
set(_plugin_enabled ON)
|
||||||
|
Reference in New Issue
Block a user