diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-14 14:24:34 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-22 08:39:15 +0000 |
commit | fac800ad1c5355e9002bf819ae06923a4edaf572 (patch) | |
tree | b52d5637499df573566f446ee3d67bc072938ecd /cmake/QtFeature.cmake | |
parent | f37ce9ab84400a45752787b9e015a7919c8771bd (diff) |
CMake: Fix cmake test for features
Features are now always defined (to OFF) when they are not emitted.
Adapt the test for that.
Change-Id: Id5f662f07fea15c22027b9b00d1b53a288b4a0dc
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'cmake/QtFeature.cmake')
-rw-r--r-- | cmake/QtFeature.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 6330200fd1..2ebf7e86e6 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -166,14 +166,16 @@ function(qt_feature_set_cache_value resultVar feature emit_if calculated label) # Initial setup: if (emit_if) set("FEATURE_${feature}" "${calculated}" CACHE BOOL "${label}") + set(result "${calculated}") + else() + set(result OFF) endif() - set(result "${calculated}") endif() set("${resultVar}" "${result}" PARENT_SCOPE) endfunction() -macro(qt_feature_set_value feature cache condition label) +macro(qt_feature_set_value feature cache emit_if condition label) set(result "${cache}") if (NOT (condition) AND (cache)) @@ -241,7 +243,7 @@ function(qt_evaluate_feature _feature) endif() qt_feature_set_cache_value(cache "${_feature}" "${emit_if}" "${result}" "${_arg_LABEL}") - qt_feature_set_value("${_feature}" "${cache}" "${condition}" "${_arg_LABEL}") + qt_feature_set_value("${_feature}" "${cache}" "${emit_if}" "${condition}" "${_arg_LABEL}") endfunction() function(qt_feature_definition _feature _name) |