aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-06-10 15:51:08 +0200
committerUlf Hermann <ulf.hermann@qt.io>2023-01-27 19:16:39 +0100
commit2d44365f69b9bc946d085c6b149e2ac319700265 (patch)
tree966cc5dcab9ef9bc3f9ab255b602bf624b692bd0 /src/qml/Qt6QmlMacros.cmake
parentd34d035022f9c7b9957cfb2abe0ba90486416ae2 (diff)
CMake: Allow omitting the version of QML modules
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is actually a bad default version since it's before all the Qt versions. [ChangeLog][QML] You can now omit the VERSION argument to qt_add_qml_module(). This will automatically generate the highest possible version. Pick-to: 6.5 Task-number: QTBUG-99146 Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index fce7156a55..ff84003599 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -122,16 +122,10 @@ function(qt6_add_qml_module target)
endif()
if (NOT arg_VERSION)
- message(FATAL_ERROR
- "Called without a module version. Please specify one using the VERSION argument."
- )
- endif()
-
- if ("${arg_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+$")
+ set(arg_VERSION "254.254")
+ elseif ("${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]+$")
+ elseif (NOT "${arg_VERSION}" MATCHES "^[0-9]+\\.[0-9]+$")
message(FATAL_ERROR
"Called with an invalid version argument: '${arg_VERSION}'. "
"Expected version in the form: VersionMajor.VersionMinor."