diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-04 17:34:27 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-05 08:13:42 +0000 |
commit | 35dc8f496dc324a816dc17e80b744bfe864ec261 (patch) | |
tree | 440e961ad57766b2e1deefd54ad02178f6bb7f69 | |
parent | d0eb985f7413c62c2bff26caaf84bec2e6893131 (diff) |
Map module.gui to if TARGET Qt::Gui in configure.cmake
Some features check for module existence. Adapt conversion script
and QtBuild feature condition parser to handle that.
Change-Id: I063e49a6fe9f8e9cf3aec985fd78ed4430398586
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | cmake/QtFeature.cmake | 8 | ||||
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index c7e4764751..33b1c7a955 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -131,6 +131,14 @@ function(qt_evaluate_config_expression resultVar) string(COMPARE EQUAL "${lhs}" "${rhs}" stringCompareResult) list(APPEND result ${stringCompareResult}) + elseif("${member}" STREQUAL "TARGET" AND memberIdx LESS ${length}) + math(EXPR rhsIndex "${memberIdx}+1") + list(GET exists_target ${rhsIndex} rhs) + if(NOT TARGET "${exists_target}") + set(result "target_does_not_exist") + break() + endif() + set(skipNext ON) else() string(FIND "${member}" "QT_FEATURE_" idx) if(idx EQUAL 0) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 890d4dfc5f..2de2567803 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -281,6 +281,8 @@ def map_condition(condition): elif match.group(1) == 'config': substitution = map_platform(match.group(2)) + elif match.group(1) == 'module': + substitution = 'TARGET {}'.format(map_qt_library(match.group(2))) elif match.group(1) == 'arch': if match.group(2) == 'i386': |