108 lines
3.3 KiB
CMake
108 lines
3.3 KiB
CMake
cmake_minimum_required(VERSION 3.1)
|
|
|
|
project(Neochat)
|
|
|
|
set(KF5_MIN_VERSION "5.76.0")
|
|
set(QT_MIN_VERSION "5.15.0")
|
|
|
|
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
|
|
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
include(FeatureSummary)
|
|
include(ECMSetupVersion)
|
|
include(KDEInstallDirs)
|
|
include(ECMQMLModules)
|
|
include(KDEClangFormat)
|
|
include(KDECMakeSettings)
|
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
|
|
|
include(cmake/Flatpak.cmake)
|
|
|
|
# Fix a crash due to problems with quotient's event system. Can probably be removed once the reworked event system is in
|
|
cmake_policy(SET CMP0063 OLD)
|
|
|
|
ecm_setup_version(1.0.1
|
|
VARIABLE_PREFIX NEOCHAT
|
|
VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/neochat-version.h
|
|
)
|
|
|
|
find_package(Qt5 ${QT_MIN_VERSION} NO_MODULE COMPONENTS Widgets Core Quick Gui QuickControls2 Multimedia Svg)
|
|
set_package_properties(Qt5 PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Basic application components"
|
|
)
|
|
find_package(KF5 ${KF5_MIN_VERSION} COMPONENTS Kirigami2 I18n Notifications Config CoreAddons)
|
|
set_package_properties(KF5 PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Basic application components"
|
|
)
|
|
set_package_properties(KF5Kirigami2 PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Kirigami application UI framework"
|
|
)
|
|
|
|
if(ANDROID)
|
|
find_package(OpenSSL)
|
|
set_package_properties(OpenSSL PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Encrypted communications"
|
|
)
|
|
else()
|
|
find_package(Qt5Keychain)
|
|
set_package_properties(Qt5Keychain PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "Secure storage of account secrets"
|
|
)
|
|
find_package(KF5DBusAddons ${KF5_MIN_VERSION})
|
|
set_package_properties(KF5DBusAddons PROPERTIES
|
|
TYPE REQUIRED
|
|
PURPOSE "DBus convenience functions"
|
|
)
|
|
endif()
|
|
|
|
find_package(Quotient 0.6)
|
|
set_package_properties(Quotient PROPERTIES
|
|
TYPE REQUIRED
|
|
DESCRIPTION "Qt wrapper arround Matrix API"
|
|
URL "https://github.com/quotient-im/libQuotient/"
|
|
PURPOSE "Talk with matrix server"
|
|
)
|
|
|
|
find_package(cmark)
|
|
set_package_properties(cmark PROPERTIES
|
|
TYPE REQUIRED
|
|
DESCRIPTION "Cmark is the common mark reference implementation"
|
|
URL "https://github.com/commonmark/cmark"
|
|
PURPOSE "Convert markdown to html"
|
|
)
|
|
|
|
ecm_find_qmlmodule(org.kde.kquickimageeditor 1.0)
|
|
ecm_find_qmlmodule(org.kde.kitemmodels 1.0)
|
|
|
|
find_package(KQuickImageEditor COMPONENTS)
|
|
set_package_properties(KQuickImageEditor PROPERTIES
|
|
TYPE REQUIRED
|
|
DESCRIPTION "Simple image editor for QtQuick applications"
|
|
URL "https://invent.kde.org/libraries/kquickimageeditor/"
|
|
PURPOSE "Add image editing capability to image attachments"
|
|
)
|
|
|
|
install(FILES org.kde.neochat.desktop DESTINATION ${KDE_INSTALL_APPDIR})
|
|
install(FILES org.kde.neochat.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
|
|
install(FILES org.kde.neochat.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
|
|
install(FILES neochat.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
|
|
|
|
# add_definitions(-DQT_NO_KEYWORDS) Need to fix libQuotient first
|
|
add_definitions(-DQT_NO_FOREACH)
|
|
|
|
add_subdirectory(src)
|
|
|
|
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
|
|
|
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
|
|
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|