summaryrefslogtreecommitdiffstats
path: root/cmake/QtFeatureCommon.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-08-12 09:17:21 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-08-13 19:31:59 +0200
commitfdd61b3a7b7a19e3d2bec475240d9fc267068390 (patch)
tree126eb5cf2a500ca4ec31df0eb6b67dfb707323d1 /cmake/QtFeatureCommon.cmake
parentfb8aea60bde5b3b3b5c1fcf263a86f5c6232c6bd (diff)
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 <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtFeatureCommon.cmake')
-rw-r--r--cmake/QtFeatureCommon.cmake9
1 files changed, 9 insertions, 0 deletions
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()