From fdd61b3a7b7a19e3d2bec475240d9fc267068390 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 12 Aug 2020 09:17:21 +0200 Subject: [PATCH] CMake: Introduce QtFeatureCommon.cmake This file provides common feature-functionality is supposed to be included by QtFeature.cmake and QtProcessConfigureArgs.cmake. Change-Id: Ifb483c2a9c4014d240c2a4d6ff07b5c0ceee9c3a Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 1 + cmake/QtFeature.cmake | 12 ++---------- cmake/QtFeatureCommon.cmake | 9 +++++++++ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 cmake/QtFeatureCommon.cmake diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index a0fcdb8dcb..15865603c6 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -355,6 +355,7 @@ qt_copy_or_install(FILES cmake/QtCompilerOptimization.cmake cmake/QtConfigDependencies.cmake.in cmake/QtFeature.cmake + cmake/QtFeatureCommon.cmake cmake/QtFinishPrlFile.cmake cmake/QtFindWrapHelper.cmake cmake/QtFindWrapConfigExtra.cmake.in diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 5058a7f86b..f7765cea94 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -1,3 +1,5 @@ +include(QtFeatureCommon) + function(qt_feature_module_begin) qt_parse_all_arguments(arg "qt_feature_module_begin" "NO_MODULE;ONLY_EVALUATE_FEATURES" @@ -35,16 +37,6 @@ function(qt_feature_module_begin) set(__QtFeature_define_definitions "" PARENT_SCOPE) endfunction() -function(qt_feature_normalize_name name out_var) - # Normalize the feature name to something CMake can deal with. - if(name MATCHES "c\\+\\+") - string(REGEX REPLACE "[^a-zA-Z0-9_]" "x" name "${name}") - else() - string(REGEX REPLACE "[^a-zA-Z0-9_]" "_" name "${name}") - endif() - set(${out_var} "${name}" PARENT_SCOPE) -endfunction() - function(qt_feature feature) set(original_name "${feature}") qt_feature_normalize_name("${feature}" feature) diff --git a/cmake/QtFeatureCommon.cmake b/cmake/QtFeatureCommon.cmake new file mode 100644 index 0000000000..5dfbeed2d5 --- /dev/null +++ b/cmake/QtFeatureCommon.cmake @@ -0,0 +1,9 @@ +function(qt_feature_normalize_name name out_var) + # Normalize the feature name to something CMake can deal with. + if(name MATCHES "c\\+\\+") + string(REGEX REPLACE "[^a-zA-Z0-9_]" "x" name "${name}") + else() + string(REGEX REPLACE "[^a-zA-Z0-9_]" "_" name "${name}") + endif() + set(${out_var} "${name}" PARENT_SCOPE) +endfunction()