2023-02-27 19:18:46 +01:00
|
|
|
# SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org>
|
2021-04-06 17:04:17 +02:00
|
|
|
# SPDX-FileCopyrightText: 2020 Nicolas Fella <nicolas.fella@gmx.de>
|
2022-12-15 21:59:19 +01:00
|
|
|
# SPDX-FileCopyrightText: 2023 Bart De Vries <bart@mogwai.be>
|
2021-04-06 17:04:17 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
2021-06-19 00:18:36 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2023-01-30 20:14:34 +01:00
|
|
|
# KDE Applications version, managed by release script.
|
|
|
|
set(RELEASE_SERVICE_VERSION_MAJOR "23")
|
2023-03-10 21:58:56 +01:00
|
|
|
set(RELEASE_SERVICE_VERSION_MINOR "07")
|
2023-08-10 20:59:24 +02:00
|
|
|
set(RELEASE_SERVICE_VERSION_MICRO "90")
|
2023-01-30 20:14:34 +01:00
|
|
|
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
|
|
|
|
|
|
|
|
project(kasts VERSION ${RELEASE_SERVICE_VERSION})
|
2020-04-23 13:47:24 +02:00
|
|
|
|
2021-04-27 09:43:58 +02:00
|
|
|
# be c++17 compliant
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2021-04-11 15:26:28 +02:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
|
2023-03-01 09:34:45 +01:00
|
|
|
set(KF_MIN_VERSION "5.102.0")
|
2023-01-21 12:49:15 +01:00
|
|
|
set(QT_MIN_VERSION "5.15.2")
|
2023-07-08 09:27:11 +02:00
|
|
|
if (ANDROID)
|
|
|
|
set(QT_MIN_VERSION 5.15.10) # due to 5.15.10 changing NDK versioning
|
|
|
|
endif()
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2023-03-01 09:34:45 +01:00
|
|
|
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2020-10-22 14:41:30 +02:00
|
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2020-10-22 14:41:30 +02:00
|
|
|
include(FeatureSummary)
|
2020-02-28 23:25:08 +01:00
|
|
|
include(ECMSetupVersion)
|
2021-05-28 22:55:18 +02:00
|
|
|
include(ECMQtDeclareLoggingCategory)
|
2021-10-07 20:56:33 +02:00
|
|
|
include(ECMGenerateExportHeader)
|
2020-02-28 23:25:08 +01:00
|
|
|
include(KDEInstallDirs)
|
2021-06-19 13:39:49 +02:00
|
|
|
include(KDEGitCommitHooks)
|
2022-11-26 07:03:24 +01:00
|
|
|
include(ECMFindQmlModule)
|
2020-02-28 23:25:08 +01:00
|
|
|
include(KDECMakeSettings)
|
|
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
2022-06-30 22:00:32 +02:00
|
|
|
include(ECMAddAppIcon)
|
2023-01-21 12:49:15 +01:00
|
|
|
include(ECMDeprecationSettings)
|
2021-11-04 19:51:06 +01:00
|
|
|
if(NOT ANDROID)
|
|
|
|
include(KDEClangFormat)
|
|
|
|
endif()
|
2021-05-28 22:55:18 +02:00
|
|
|
|
2021-05-27 23:19:21 +02:00
|
|
|
ecm_setup_version(${PROJECT_VERSION}
|
2021-05-03 22:16:19 +02:00
|
|
|
VARIABLE_PREFIX KASTS
|
|
|
|
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kasts-version.h
|
2020-10-22 14:41:30 +02:00
|
|
|
)
|
|
|
|
|
2023-01-23 20:55:57 +01:00
|
|
|
ecm_set_disabled_deprecation_versions(
|
|
|
|
QT 5.15.2
|
2023-01-21 12:49:15 +01:00
|
|
|
KF 5.102.0
|
|
|
|
)
|
|
|
|
|
2023-03-01 09:34:45 +01:00
|
|
|
if (QT_MAJOR_VERSION EQUAL "6")
|
|
|
|
set(KF_MAJOR_VERSION "6")
|
|
|
|
else()
|
|
|
|
set(KF_MAJOR_VERSION "5")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Sql Svg Xml)
|
|
|
|
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Kirigami2 Syndication Config ThreadWeaver)
|
2023-06-02 14:23:26 +02:00
|
|
|
|
|
|
|
if (QT_MAJOR_VERSION EQUAL "6")
|
|
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Network)
|
|
|
|
else()
|
|
|
|
find_package(KF${KF_MAJOR_VERSION} ${KF_MIN_VERSION} OPTIONAL_COMPONENTS NetworkManagerQt)
|
|
|
|
endif()
|
|
|
|
|
2023-03-01 09:34:45 +01:00
|
|
|
if (NOT KF_MAJOR_VERSION EQUAL "6") # TODO temporary workaround until kirigami-addons is switched to KF6
|
2023-02-17 22:14:57 +01:00
|
|
|
find_package(KF5KirigamiAddons 0.7 REQUIRED)
|
2023-03-01 09:34:45 +01:00
|
|
|
endif()
|
2023-06-02 14:23:26 +02:00
|
|
|
|
2021-10-05 21:34:19 +02:00
|
|
|
find_package(Taglib REQUIRED)
|
2022-04-22 00:59:44 +02:00
|
|
|
find_package(Qt${QT_MAJOR_VERSION}Keychain)
|
|
|
|
set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
|
2021-10-29 17:00:52 +02:00
|
|
|
TYPE REQUIRED
|
|
|
|
PURPOSE "Secure storage of account secrets"
|
|
|
|
)
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2020-04-21 23:27:15 +02:00
|
|
|
if (ANDROID)
|
2023-01-18 11:37:15 +01:00
|
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Svg)
|
|
|
|
if (QT_MAJOR_VERSION EQUAL "5")
|
|
|
|
find_package(Qt5 REQUIRED COMPONENTS AndroidExtras)
|
|
|
|
endif()
|
2020-04-28 21:32:24 +02:00
|
|
|
find_package(OpenSSL REQUIRED)
|
2021-10-07 01:48:10 +02:00
|
|
|
find_package(SQLite3)
|
2021-10-07 10:57:53 +02:00
|
|
|
find_package(ZLIB)
|
2021-10-07 20:56:33 +02:00
|
|
|
find_package(Gradle)
|
2020-04-21 23:27:15 +02:00
|
|
|
else()
|
2022-04-22 00:59:44 +02:00
|
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS Widgets DBus)
|
2020-04-21 23:27:15 +02:00
|
|
|
endif()
|
|
|
|
|
2020-10-22 14:41:30 +02:00
|
|
|
add_definitions(-DQT_NO_CAST_FROM_ASCII
|
|
|
|
-DQT_NO_CAST_TO_ASCII
|
|
|
|
-DQT_NO_URL_CAST_FROM_STRING
|
|
|
|
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
|
|
|
-DQT_USE_QSTRINGBUILDER
|
|
|
|
)
|
2020-04-21 23:27:15 +02:00
|
|
|
|
2022-04-07 17:00:44 +02:00
|
|
|
ki18n_install(po)
|
|
|
|
|
2021-05-03 22:16:19 +02:00
|
|
|
install(PROGRAMS org.kde.kasts.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
|
|
|
install(FILES org.kde.kasts.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
|
|
|
install(FILES kasts.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
2023-02-27 13:12:03 +01:00
|
|
|
install(FILES icons/kasts-tray-dark.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
|
|
|
install(FILES icons/kasts-tray-light.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
2023-05-10 14:30:43 +02:00
|
|
|
install(FILES icons/media-playback-cloud.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/actions)
|
2020-02-28 23:25:08 +01:00
|
|
|
|
2021-11-15 17:13:22 +01:00
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
|
|
|
|
|
2020-02-28 23:25:08 +01:00
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
2020-04-21 23:27:15 +02:00
|
|
|
|
2021-06-19 15:39:40 +02:00
|
|
|
if (NOT ANDROID)
|
|
|
|
# inside if-statement to work around problems with gitlab Android CI
|
2021-11-04 19:51:06 +01:00
|
|
|
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
|
|
|
|
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|
2021-06-19 15:39:40 +02:00
|
|
|
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
|
|
|
|
endif()
|