diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-02-03 10:07:01 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-05-12 09:40:43 +0200 |
commit | 5cf3eaa127b4633b46e1d6b70eb42253464bcd97 (patch) | |
tree | 5dad1e3d68fafac477860ef8f241d05b6b749829 /cmake | |
parent | a60304e7ea154438060a71959f72a4a1b95f5327 (diff) |
Pass qtfeatures from the main project to the lib project
Task-number: QTBUG-91760
Change-Id: I56aaf6af42eb1877acbc0faf4e125bc8de4c72fb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Functions.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index b954654bf..89dff400f 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -39,3 +39,20 @@ function(add_check_for_support errorResult supportResult) endif() endif() endfunction() + +function(get_qt_features outList module) + get_cmake_property(variableList VARIABLES) + set(_featureList "") + foreach (variableKey ${variableList}) + unset(FOUND) + string(REGEX MATCH QT_FEATURE_${module} FOUND ${variableKey}) + if (FOUND) + list(APPEND _featureList "${variableKey}=${${variableKey}}") + endif() + endforeach() + if ("${${outList}}" STREQUAL "") + set(${outList} ${_featureList} PARENT_SCOPE) + else() + set(${outList} "${${outList}}" "${_featureList}" PARENT_SCOPE) + endif() +endfunction() |