Commit aa57b34f authored by Xuetian Weng's avatar Xuetian Weng
Browse files

Detect QQC2 version at build time with actual detection.

Summary:
Whenever qqc release a new version the version need to be updated.
Otherwise the feature is not available to user. This change tries
to use real qml code to detect the version by creating object until
success, force to use a minimal qpa platform when running it.

Test Plan:
Run the cmake under a env without display server and version is detected
correctly.

Reviewers: #plasma, rizzitello, davidedmundson, apol, mart

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28859
parent 2c777b1b
...@@ -117,9 +117,15 @@ if (KF5IconThemes_FOUND AND KF5WidgetsAddons_FOUND) ...@@ -117,9 +117,15 @@ if (KF5IconThemes_FOUND AND KF5WidgetsAddons_FOUND)
add_subdirectory(kirigami-plasmadesktop-integration) add_subdirectory(kirigami-plasmadesktop-integration)
endif(KF5IconThemes_FOUND AND KF5WidgetsAddons_FOUND) endif(KF5IconThemes_FOUND AND KF5WidgetsAddons_FOUND)
#FIXME: this assumes there will always be a QQC2 release for each Qt release, needs # FIXME: this assumes there will always be a QQC2 release for each Qt release, needs
#something to discover what's the latest qqc2 version available # something to discover what's the latest qqc2 version available
math(EXPR QQC2_VERSION_MINOR "${Qt5QuickControls2_VERSION_MINOR} - 7") # Since 5.12, QQC2 version is sync with Qt's minor version:
# https://github.com/qt/qtquickcontrols2/commit/3c7bfc156797b2f3ef08a8cf620b79da80e4b061
if (Qt5QuickControls2_VERSION_MINOR LESS 12)
math(EXPR QQC2_VERSION_MINOR "${Qt5QuickControls2_VERSION_MINOR} - 7")
else()
set(QQC2_VERSION_MINOR "${Qt5QuickControls2_VERSION_MINOR}")
endif()
set(QQC2_VERSION "2.${QQC2_VERSION_MINOR}") set(QQC2_VERSION "2.${QQC2_VERSION_MINOR}")
if (QQC2_VERSION_MINOR LESS 3) if (QQC2_VERSION_MINOR LESS 3)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment