From ec510d0ebcaabbdfafc4eb6545150376871d5468 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 25 Oct 2018 13:16:42 +0200 Subject: [PATCH] Store QT_FEATUREs that are not emitted Store QT_FEATUREs that are not emitted, but do not show them in the UI. Also separate out the UI (FEATURE_foo) from the internal CMake value (QT_FEATURE_foo). This does break the overriding of settings, but that did not work well before either. This will be fixed in follow-up patches. Remove fallout: xkbcommon_system was now evaluated where it was not before. Remove it as that is always the case now. Change-Id: I2d303827a1cc9afeef93ad73285a2043ddaa9766 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 34 +++++++++++++----------- src/plugins/platforms/xcb/CMakeLists.txt | 12 --------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index a4d9421935..8073f5178b 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -32,22 +32,14 @@ function(qt_feature _feature) "PRIVATE;PUBLIC" "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${ARGN}) - if("${_arg_EMIT_IF}" STREQUAL "") - set(_arg_EMIT_IF 1) + # Register feature for future use: + if (_arg_PUBLIC) + list(APPEND __QtFeature_public_features "${_feature}") + endif() + if (_arg_PRIVATE) + list(APPEND __QtFeature_private_features "${_feature}") endif() - if (${_arg_EMIT_IF}) - set(QT_FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") - set_property(CACHE QT_FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) - - # Register feature for future use: - if (_arg_PUBLIC) - list(APPEND __QtFeature_public_features "${_feature}") - endif() - if (_arg_PRIVATE) - list(APPEND __QtFeature_private_features "${_feature}") - endif() - endif() set(__QtFeature_public_features ${__QtFeature_public_features} PARENT_SCOPE) set(__QtFeature_private_features ${__QtFeature_private_features} PARENT_SCOPE) endfunction() @@ -114,7 +106,7 @@ function(qt_evaluate_config_expression resultVar) elseif("${member}" STREQUAL "STREQUAL" AND memberIdx LESS ${length}) # Unfortunately the semantics for STREQUAL in if() are broken when the # RHS is an empty string and the parameters to if are coming through a variable. - # So we expect people two write the empty string with single quotes and then we + # So we expect people to write the empty string with single quotes and then we # do the comparison manually here. list(LENGTH result lhsIndex) math(EXPR lhsIndex "${lhsIndex}-1") @@ -157,7 +149,8 @@ endfunction() function(qt_evaluate_feature _feature) # If the feature was set explicitly by the user to be on or off, in the cache, then # there's nothing for us to do. - if(NOT QT_FEATURE_${_feature} STREQUAL UNSET) + if(DEFINED "QT_FEATURE_${_feature}") + message("${_feature} is already defined...") return() endif() @@ -201,6 +194,15 @@ function(qt_evaluate_feature _feature) set(QT_FEATURE_COMPUTED_VALUE_${_feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") set(QT_FEATURE_${_feature} "${result}" PARENT_SCOPE) + + if("${_arg_EMIT_IF}" STREQUAL "") + set(_arg_EMIT_IF ON) + endif() + + if (${_arg_EMIT_IF}) + set(FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") + set_property(CACHE FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) + endif() endfunction() function(qt_feature_definition _feature _name) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index fc7a6eb1bf..d1fff8bf25 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -122,18 +122,6 @@ extend_target(XcbQpa CONDITION QT_FEATURE_vulkan #extend_target(XcbQpa CONDITION NOT QT_FEATURE_xkbcommon_system #) -extend_target(XcbQpa CONDITION (NOT QT_FEATURE_xkbcommon_system) AND (QT_FEATURE_xkb) - INCLUDE_DIRECTORIES - ../../../3rdparty/xkbcommon/src/x11 -) - -extend_target(XcbQpa CONDITION (NOT QT_FEATURE_xkbcommon_system) AND (NOT QT_FEATURE_xkb) - INCLUDE_DIRECTORIES - ../../../3rdparty/xkbcommon - ../../../3rdparty/xkbcommon/xkbcommon - ../../../3rdparty/xkbcommon/src - ../../../3rdparty/xkbcommon/src/xkbcomp -) # #extend_target(XcbQpa CONDITION NOT NOT QT_FEATURE_xkbcommon_system #)