Warning, /network/tokodon/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org> 0002 # SPDX-License-Identifier: BSD-2-Clause 0003 0004 cmake_minimum_required(VERSION 3.16) 0005 0006 # KDE Applications version, managed by release script. 0007 set(RELEASE_SERVICE_VERSION_MAJOR "23") 0008 set(RELEASE_SERVICE_VERSION_MINOR "08") 0009 set(RELEASE_SERVICE_VERSION_MICRO "5") 0010 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") 0011 0012 project(tokodon VERSION ${RELEASE_SERVICE_VERSION}) 0013 0014 option(SAILFISHOS "Build for sailfishOS" OFF) 0015 0016 set(KF_MIN_VERSION "5.77.0") 0017 set(QT_MIN_VERSION "5.15.0") 0018 if (ANDROID) 0019 set(QT_MIN_VERSION "5.15.10") 0020 endif() 0021 0022 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) 0023 0024 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) 0025 0026 set(CMAKE_CXX_STANDARD 17) 0027 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0028 0029 include(FeatureSummary) 0030 include(ECMSetupVersion) 0031 include(KDEInstallDirs) 0032 include(ECMQMLModules) 0033 include(KDEClangFormat) 0034 include(ECMQtDeclareLoggingCategory) 0035 include(KDECMakeSettings) 0036 include(KDECompilerSettings NO_POLICY_SCOPE) 0037 include(ECMAddAppIcon) 0038 include(ECMAddTests) 0039 include(KDEGitCommitHooks) 0040 0041 ecm_setup_version(${PROJECT_VERSION} 0042 VARIABLE_PREFIX TOKODON 0043 VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/tokodon-version.h 0044 ) 0045 0046 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} NO_MODULE COMPONENTS Widgets Core Quick Gui QuickControls2 Svg WebSockets Test) 0047 set_package_properties(Qt${QT_MAJOR_VERSION} PROPERTIES 0048 TYPE REQUIRED 0049 PURPOSE "Basic application components" 0050 ) 0051 find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons) 0052 set_package_properties(KF${QT_MAJOR_VERSION} PROPERTIES 0053 TYPE REQUIRED 0054 PURPOSE "Basic application components" 0055 ) 0056 set_package_properties(KF${QT_MAJOR_VERSION}Kirigami2 PROPERTIES 0057 TYPE REQUIRED 0058 PURPOSE "Kirigami application UI framework" 0059 ) 0060 find_package(KF${QT_MAJOR_VERSION}KirigamiAddons 0.11 REQUIRED) 0061 find_package(Qt${QT_MAJOR_VERSION}Keychain) 0062 set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES 0063 TYPE REQUIRED 0064 PURPOSE "Secure storage of account secrets" 0065 ) 0066 0067 if (ANDROID) 0068 find_package(OpenSSL) 0069 set_package_properties(OpenSSL PROPERTIES 0070 TYPE REQUIRED 0071 PURPOSE "Encrypted communications" 0072 ) 0073 else() 0074 if (NOT SAILFISHOS) 0075 find_package(KF${QT_MAJOR_VERSION}QQC2DesktopStyle REQUIRED) 0076 endif() 0077 find_package(KF${QT_MAJOR_VERSION}ConfigWidgets REQUIRED) 0078 endif () 0079 0080 if (UNIX AND NOT APPLE AND NOT ANDROID) 0081 find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS KIO) 0082 endif () 0083 0084 if (NOT ANDROID AND NOT WIN32 AND NOT APPLE) 0085 find_package(KF${QT_MAJOR_VERSION}DBusAddons ${KF_MIN_VERSION} REQUIRED) 0086 find_package(KF${QT_MAJOR_VERSION}WindowSystem ${KF_MIN_VERSION} REQUIRED) 0087 endif () 0088 0089 find_package(PkgConfig REQUIRED) 0090 pkg_check_modules(MPV REQUIRED mpv) 0091 0092 ecm_find_qmlmodule(org.kde.kitemmodels 1.0) 0093 ecm_find_qmlmodule(org.kde.sonnet 1.0) 0094 0095 add_definitions(-DQT_NO_FOREACH -DQT_NO_KEYWORDS) 0096 0097 add_subdirectory(src) 0098 0099 ki18n_install(po) 0100 0101 if (ANDROID) 0102 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle) 0103 kirigami_package_breeze_icons(ICONS bookmarks) 0104 endif() 0105 0106 install(FILES org.kde.tokodon.desktop DESTINATION ${KDE_INSTALL_APPDIR}) 0107 install(FILES org.kde.tokodon.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) 0108 install(FILES org.kde.tokodon.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) 0109 0110 ecm_qt_install_logging_categories( 0111 EXPORT TOKODON 0112 FILE tokodon.categories 0113 SORT DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} 0114 ) 0115 0116 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0117 0118 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h) 0119 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) 0120 0121 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)