CMake: Check for visibility once

Change-Id: I5c729f4509eed16409df5eb048afb7f60c5ca57c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Tobias Hunger 2019-01-14 11:01:06 +01:00
parent 3552323049
commit b705021b4e

View File

@ -412,12 +412,13 @@ function(qt_pull_features_into_current_scope)
else()
set(property_prefix "")
endif()
foreach(visibility PUBLIC PRIVATE)
foreach(visibility IN ITEMS PUBLIC PRIVATE)
if(NOT ${arg_${visibility}_FEATURES})
continue()
endif()
set(value ON)
foreach(state ENABLED DISABLED)
if(NOT ${arg_${visibility}_FEATURES})
continue()
endif()
foreach(state IN ITEMS ENABLED DISABLED)
get_target_property(features "${target}" ${property_prefix}QT_${arg_FEATURE_PROPERTY_INFIX}${state}_${visibility}_FEATURES)
if("${features}" STREQUAL "features-NOTFOUND")
continue()