diff options
-rw-r--r-- | cmake/QtBuild.cmake | 18 | ||||
-rw-r--r-- | cmake/QtFeature.cmake | 11 |
2 files changed, 22 insertions, 7 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 5fa81fe807..2ade160779 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -696,12 +696,26 @@ endfunction() function(qt_correct_config out_var config) set(corrected_config "") foreach(name ${config}) + # Is the config value a known feature? get_property(feature_original_name GLOBAL PROPERTY "QT_FEATURE_ORIGINAL_NAME_${name}") if(feature_original_name) list(APPEND corrected_config "${feature_original_name}") - else() - list(APPEND corrected_config "${name}") + continue() endif() + + # Is the config value a negated known feature, e.g. no_foo? + # Then add the config value no-foo. + if(name MATCHES "^no_(.*)") + get_property(feature_original_name GLOBAL PROPERTY + "QT_FEATURE_ORIGINAL_NAME_${CMAKE_MATCH_1}") + if(feature_original_name) + list(APPEND corrected_config "no-${feature_original_name}") + continue() + endif() + endif() + + # The config value is no known feature. Add the value as is. + list(APPEND corrected_config "${name}") endforeach() set(${out_var} ${corrected_config} PARENT_SCOPE) endfunction() diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 4cf7c0f946..52475dfa85 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -312,16 +312,17 @@ function(qt_evaluate_qmake_config_values key) "FEATURE;NAME;CONFIG_VAR_NAME" "" ${${key}}) - set(expected "NOT") - if (arg_NEGATE) - set(expected "") - endif() - # If no custom name is specified, then the config value is the same as the feature name. if(NOT arg_NAME) set(arg_NAME "${arg_FEATURE}") endif() + set(expected "NOT") + if (arg_NEGATE) + set(expected "") + string(PREPEND arg_NAME "no_") + endif() + # The feature condition is false, there is no need to export any config values. if(${expected} ${QT_FEATURE_${arg_FEATURE}}) return() |