cmake: QtFeature: Do not error out when using Qt

... outside of qtbase.git

Change-Id: I1895ef07c881766e2b28839d0422916b6916e10e
Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Kevin Funk 2019-02-11 10:55:07 +01:00
parent c5e2838b64
commit 2635ab01d2

View File

@ -430,8 +430,8 @@ function(qt_make_features_available target)
continue()
endif()
foreach(feature IN ITEMS ${features})
if (DEFINED "QT_FEATURE_${feature}")
message(FATAL_ERROR "Feature ${feature} is already defined when importing features from ${target}.")
if (DEFINED "QT_FEATURE_${feature}" AND NOT "${QT_FEATURE_${feature}}" STREQUAL "${value}")
message(FATAL_ERROR "Feature ${feature} is already defined and has a different value when importing features from ${target}.")
endif()
set(QT_FEATURE_${feature} "${value}" CACHE INTERNAL "Qt feature: ${feature} (from target ${target})")
endforeach()