From 1cf0c1193ad2ff8812baa36e68ca81872d7d3d40 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 5 Mar 2021 14:25:46 +0100 Subject: CMake: Strip patch version QML module VERSION argument QML only knows major and minor versions. Change-Id: Ia2c925616361d9e41d304ea5dc0ea53b998efc5b Reviewed-by: Fabian Kosmale --- src/qml/Qt6QmlMacros.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3