summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-09-26 15:39:06 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-09-26 14:30:14 +0000
commit992fe06b30337442b96e5f8b6553e518fedcd372 (patch)
tree967a1897d1a8478a8e1ecb5066fd71f37a0908ad
parentdeeddf2cb1148a01148c84756c25be2be382a773 (diff)
cmake: Support CMake-typical booly values for -DFEATURE_*
Allow setting feature defines to ON, YES, TRUE, Y, OFF, NO, FALSE, N and non-negative numbers like it's possible for other defines. We'll not allow IGNORE and NOTFOUND, because they're a bit strange in the context of features. Change-Id: I7f6cd6dff4c68972921b499b28916c9ad789d510 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
-rw-r--r--cmake/QtFeature.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake
index 9d0e408980..3a8a04c253 100644
--- a/cmake/QtFeature.cmake
+++ b/cmake/QtFeature.cmake
@@ -163,7 +163,8 @@ function(qt_feature_set_cache_value resultVar feature emit_if calculated label)
# Revisit value:
set(cache "${FEATURE_${feature}}")
- if ((cache STREQUAL "ON") OR (cache STREQUAL "OFF"))
+ set(booly_values OFF NO FALSE N ON YES TRUE Y)
+ if ((cache IN_LIST booly_values) OR (cache GREATER_EQUAL 0))
set(result "${cache}")
else()
message(FATAL_ERROR "Sanity check failed: FEATURE_${feature} has invalid value \"${cache}\"!")