Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F113809
D43.1732489115.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D43.1732489115.diff
View Options
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.13)
+cmake_minimum_required(VERSION 3.16)
project(kazv)
@@ -12,10 +12,22 @@
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_CXX_STANDARD 17)
-set(QT5_MIN_VERSION 5.15)
-set(KF5_MIN_VERSION 5.78)
+if(NOT kazv_KF_QT_MAJOR_VERSION)
+ set(kazv_KF_QT_MAJOR_VERSION 5)
+endif()
+message(STATUS "KF/Qt major version: ${kazv_KF_QT_MAJOR_VERSION}")
+
+set(QT_MAJOR_VERSION ${kazv_KF_QT_MAJOR_VERSION})
+set(KF_MAJOR_VERSION ${kazv_KF_QT_MAJOR_VERSION})
+
+if(QT_MAJOR_VERSION EQUAL 5)
+ set(QT_MIN_VERSION 5.15)
+endif()
+if(KF_MAJOR_VERSION EQUAL 5)
+ set(KF_MIN_VERSION 5.78)
+endif()
-find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
+find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
@@ -27,12 +39,19 @@
include(ECMPoQmTools)
include(ECMAddTests)
include(ECMQtDeclareLoggingCategory)
+include(ECMDeprecationSettings)
+
+ecm_set_disabled_deprecation_versions(
+ QT 5.15.14
+ KF 5.116.0
+ KCOREADDONS 5.116.0
+)
-find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED COMPONENTS
+find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS
Core Gui Qml QuickControls2 Svg Concurrent Widgets
Multimedia Test Network QuickTest
)
-find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 Config KIO Notifications)
+find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 Config KIO Notifications)
find_package(Threads REQUIRED)
find_package(nlohmann_json REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,11 +61,18 @@
target_link_libraries(kazvprivlib PUBLIC
libkazv::kazvall
- Qt5::Core
- Qt5::Network
+ Qt${QT_MAJOR_VERSION}::Core
+ Qt${QT_MAJOR_VERSION}::Network
Threads::Threads
- Qt5::Gui Qt5::Qml Qt5::Quick Qt5::QuickControls2 Qt5::Svg Qt5::Concurrent Qt5::Widgets
- KF5::ConfigCore KF5::KIOCore KF5::Notifications
+ Qt${QT_MAJOR_VERSION}::Gui
+ Qt${QT_MAJOR_VERSION}::Qml
+ Qt${QT_MAJOR_VERSION}::Quick
+ Qt${QT_MAJOR_VERSION}::QuickControls2
+ Qt${QT_MAJOR_VERSION}::Svg
+ Qt${QT_MAJOR_VERSION}::Concurrent
+ Qt${QT_MAJOR_VERSION}::Widgets
+ KF${KF_MAJOR_VERSION}::ConfigCore KF${KF_MAJOR_VERSION}::KIOCore
+ KF${KF_MAJOR_VERSION}::Notifications
${CMARK_TARGET_NAME}
)
@@ -83,7 +90,11 @@
PRIVATE
kazvprivlib
)
-install(TARGETS kazv ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+set(kazv_INSTALL_ARGS ${KF_INSTALL_TARGETS_DEFAULT_ARGS})
+if(NOT kazv_INSTALL_ARGS)
+ set(kazv_INSTALL_ARGS ${KF${KF_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
+endif()
+install(TARGETS kazv ${kazv_INSTALL_ARGS})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/l10n/
DESTINATION ${KAZV_L10N_DIR}
FILES_MATCHING PATTERN "*.ftl"
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -20,19 +20,19 @@
matrix-sticker-pack-test.cpp
matrix-link-test.cpp
matrix-user-given-attrs-map-test.cpp
- LINK_LIBRARIES Qt5::Test kazvtestlib
+ LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test kazvtestlib
)
ecm_add_test(
quick-test.cpp
TEST_NAME quicktest
- LINK_LIBRARIES Qt5::QuickTest kazvtestlib
+ LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::QuickTest kazvtestlib
)
if(KAZV_BUILD_BENCHMARKS)
ecm_add_test(
matrix-room-timeline-benchmark-test.cpp
- LINK_LIBRARIES Qt5::Test kazvtestlib
+ LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test kazvtestlib
)
endif()
set_tests_properties(quicktest PROPERTIES WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 2:58 PM (11 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39831
Default Alt Text
D43.1732489115.diff (3 KB)
Attached To
Mode
D43: Use a variable to control KF/Qt version in CMake
Attached
Detach File
Event Timeline
Log In to Comment