aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-03-05 14:25:46 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-03-05 22:03:16 +0100
commit1cf0c1193ad2ff8812baa36e68ca81872d7d3d40 (patch)
tree17eb0d51fd4cfd5149b565c000643fd0ea44a06d
parent63735fb1b1169fb1538104b0017645c009772ecc (diff)
CMake: Strip patch version QML module VERSION argument
QML only knows major and minor versions. Change-Id: Ia2c925616361d9e41d304ea5dc0ea53b998efc5b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-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()