aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/Qt6QmlMacros.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 2a22831794..06d4264088 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -142,7 +142,11 @@ function(qt6_add_qml_module target)
message(FATAL_ERROR "qt6_add_qml_module called without a module version. Please specify one using the VERSION argument.")
endif()
- if (NOT "${arg_VERSION}" MATCHES "[0-9]+\\.[0-9]+")
+ if ("${arg_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+$")
+ set(arg_VERSION "${CMAKE_MATCH_1}")
+ endif()
+
+ if (NOT "${arg_VERSION}" MATCHES "^[0-9]+\\.[0-9]+$")
message(FATAL_ERROR "qt6_add_qml_module called with an invalid version argument: '${arg_VERSION}'. Expected version style: VersionMajor.VersionMinor.")
endif()