Warning, /network/neochat/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2020-2021 Carl Schwan <carl@carlschwan.eu>
0002 # SPDX-FileCopyrightText: 2020-2021 Nicolas Fella <nicolas.fella@gmx.de>
0003 # SPDX-FileCopyrightText: 2020-2021 Tobias Fella <tobias.fella@kde.org>
0004 # SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
0005 # SPDX-License-Identifier: BSD-2-Clause
0006 
0007 cmake_minimum_required(VERSION 3.16)
0008 
0009 # KDE Applications version, managed by release script.
0010 set(RELEASE_SERVICE_VERSION_MAJOR "24")
0011 set(RELEASE_SERVICE_VERSION_MINOR "04")
0012 set(RELEASE_SERVICE_VERSION_MICRO "70")
0013 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0014 
0015 project(NeoChat VERSION ${RELEASE_SERVICE_VERSION})
0016 
0017 set(KF_MIN_VERSION "5.240.0")
0018 set(QT_MIN_VERSION "6.5")
0019 
0020 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
0021 
0022 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0023 
0024 set(CMAKE_CXX_STANDARD 20)
0025 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0026 
0027 set(KDE_COMPILERSETTINGS_LEVEL 5.105)
0028 
0029 include(FeatureSummary)
0030 include(ECMSetupVersion)
0031 include(KDEInstallDirs)
0032 include(ECMFindQmlModule)
0033 include(KDECMakeSettings)
0034 include(ECMAddTests)
0035 include(KDECompilerSettings NO_POLICY_SCOPE)
0036 include(ECMAddAppIcon)
0037 include(KDEGitCommitHooks)
0038 include(ECMCheckOutboundLicense)
0039 include(ECMQtDeclareLoggingCategory)
0040 include(ECMAddAndroidApk)
0041 if (NOT ANDROID)
0042     include(KDEClangFormat)
0043 endif()
0044 
0045 if(NEOCHAT_FLATPAK)
0046     include(cmake/Flatpak.cmake)
0047 endif()
0048 
0049 set(QUOTIENT_FORCE_NAMESPACED_INCLUDES TRUE)
0050 
0051 ecm_setup_version(${PROJECT_VERSION}
0052     VARIABLE_PREFIX NEOCHAT
0053     VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h
0054 )
0055 
0056 find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Core Quick Gui QuickControls2 Multimedia Svg WebView)
0057 set_package_properties(Qt6 PROPERTIES
0058     TYPE REQUIRED
0059     PURPOSE "Basic application components"
0060 )
0061 find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami I18n Notifications Config CoreAddons Sonnet ItemModels ColorScheme)
0062 set_package_properties(KF6 PROPERTIES
0063     TYPE REQUIRED
0064     PURPOSE "Basic application components"
0065 )
0066 set_package_properties(KF6Kirigami PROPERTIES
0067     TYPE REQUIRED
0068     PURPOSE "Kirigami application UI framework"
0069 )
0070 find_package(KF6KirigamiAddons 0.7.2 REQUIRED)
0071 
0072 if(ANDROID)
0073     find_package(OpenSSL)
0074     set_package_properties(OpenSSL PROPERTIES
0075         TYPE REQUIRED
0076         PURPOSE "Encrypted communications"
0077     )
0078 else()
0079     find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS Widgets)
0080     find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem StatusNotifierItem)
0081     set_package_properties(KF6QQC2DesktopStyle PROPERTIES
0082         TYPE RUNTIME
0083     )
0084     ecm_find_qmlmodule(org.kde.syntaxhighlighting 1.0)
0085 
0086     find_package(ICU 61.0 COMPONENTS uc)
0087     set_package_properties(ICU PROPERTIES
0088         TYPE REQUIRED
0089         PURPOSE "Unicode library"
0090     )
0091 endif()
0092 
0093 if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
0094     find_package(KF6DBusAddons ${KF_MIN_VERSION} REQUIRED)
0095 endif()
0096 
0097 find_package(QuotientQt6 0.7)
0098 set_package_properties(QuotientQt6 PROPERTIES
0099     TYPE REQUIRED
0100     DESCRIPTION "Qt wrapper around Matrix API"
0101     URL "https://github.com/quotient-im/libQuotient/"
0102     PURPOSE "Talk with matrix server"
0103 )
0104 
0105 if (NOT TARGET Olm::Olm)
0106     message(FATAL_ERROR "NeoChat requires Quotient with the E2EE feature enabled")
0107 endif()
0108 
0109 
0110 find_package(cmark)
0111 set_package_properties(cmark PROPERTIES
0112     TYPE REQUIRED
0113     DESCRIPTION "Cmark is the common mark reference implementation"
0114     URL "https://github.com/commonmark/cmark"
0115     PURPOSE "Convert markdown to html"
0116 )
0117 
0118 ecm_find_qmlmodule(org.kde.kquickimageeditor 1.0)
0119 ecm_find_qmlmodule(org.kde.kitemmodels 1.0)
0120 ecm_find_qmlmodule(org.kde.quickcharts 1.0)
0121 ecm_find_qmlmodule(QtLocation)
0122 ecm_find_qmlmodule(org.kde.prison)
0123 
0124 find_package(KQuickImageEditor COMPONENTS)
0125 set_package_properties(KQuickImageEditor PROPERTIES
0126     TYPE REQUIRED
0127     DESCRIPTION "Simple image editor for QtQuick applications"
0128     URL "https://invent.kde.org/libraries/kquickimageeditor/"
0129     PURPOSE "Add image editing capability to image attachments"
0130 )
0131 
0132 find_package(QCoro6 0.4 COMPONENTS Core Network REQUIRED)
0133 
0134 qcoro_enable_coroutines()
0135 
0136 find_package(KF6DocTools ${KF_MIN_VERSION})
0137 set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
0138     "Tools to generate documentation"
0139     TYPE OPTIONAL
0140 )
0141 
0142 find_package(KUnifiedPush QUIET)
0143 set_package_properties(KUnifiedPush PROPERTIES
0144     TYPE OPTIONAL
0145     PURPOSE "Push notification support"
0146     URL "https://invent.kde.org/libraries/kunifiedpush"
0147 )
0148 
0149 if(ANDROID)
0150     find_package(Sqlite3)
0151     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)
0152 endif()
0153 
0154 ki18n_install(po)
0155 
0156 install(FILES org.kde.neochat.desktop DESTINATION ${KDE_INSTALL_APPDIR})
0157 install(FILES org.kde.neochat.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0158 install(FILES org.kde.neochat.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
0159 install(FILES org.kde.neochat.tray.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
0160 
0161 add_definitions(-DQT_NO_FOREACH)
0162 
0163 add_subdirectory(src)
0164 
0165 if (BUILD_TESTING)
0166     find_package(Qt6 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Test)
0167     add_subdirectory(autotests)
0168     add_subdirectory(appiumtests)
0169 endif()
0170 
0171 if(KF6DocTools_FOUND)
0172     kdoctools_install(po)
0173     add_subdirectory(doc)
0174 endif()
0175 
0176 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0177 
0178 if (NOT ANDROID)
0179     file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
0180     kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0181 
0182     kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
0183 endif()
0184 file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.h *.qml)
0185 # CI installs dependency headers to _install and _build, which break the reuse check
0186 # Fixes the test by excluding this directory
0187 list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX [[_(install|build)/.*]])
0188 ecm_check_outbound_license(LICENSES GPL-3.0-only FILES ${ALL_SOURCE_FILES})
0189 
0190 ecm_qt_install_logging_categories(
0191         EXPORT NEOCHAT
0192         FILE neochat.categories
0193         DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
0194         )