From 5cf3eaa127b4633b46e1d6b70eb42253464bcd97 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 3 Feb 2021 10:07:01 +0100 Subject: Pass qtfeatures from the main project to the lib project Task-number: QTBUG-91760 Change-Id: I56aaf6af42eb1877acbc0faf4e125bc8de4c72fb Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Joerg Bornemann --- cmake/Functions.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cmake/Functions.cmake') 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() -- cgit v1.2.3