Warning, /maui/communicator/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # Copyright 2018-2020 Camilo Higuita <milo.h@aol.com> 0002 # Copyright 2018-2020 Nitrux Latinoamericana S.C. 0003 # 0004 # SPDX-License-Identifier: GPL-3.0-or-latercmake_minimum_required(VERSION 3.14) 0005 0006 cmake_minimum_required(VERSION 3.16) 0007 0008 set(COMMUNICATOR_VERSION 3.1.0) 0009 add_compile_definitions(APP_COPYRIGHT_NOTICE="© 2019-2024 Maui Development Team") 0010 0011 set(CMAKE_CXX_STANDARD 17) 0012 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0013 0014 set(CMAKE_INCLUDE_CURRENT_DIR ON) 0015 0016 set(CMAKE_AUTOUIC ON) 0017 set(CMAKE_AUTOMOC ON) 0018 set(CMAKE_AUTORCC ON) 0019 0020 project(communicator VERSION ${COMMUNICATOR_VERSION}) 0021 0022 set(REQUIRED_QT_VERSION 5.14.0) 0023 set(REQUIRED_KF5_VERSION 5.60) 0024 0025 if(ANDROID) 0026 set(ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android_files) 0027 set(ANDROID_ABIS "armeabi-v7a") 0028 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android_files/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle) 0029 endif() 0030 0031 option(QUICK_COMPILER "Use QtQuick compiler to improve performance" TRUE) 0032 0033 find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE) 0034 0035 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH}) 0036 0037 find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Qml Quick QuickControls2 Concurrent) 0038 0039 find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS I18n CoreAddons Service) 0040 0041 find_package(MauiKit3 REQUIRED) 0042 find_package(MauiKit3 REQUIRED COMPONENTS FileBrowsing) 0043 0044 if(ANDROID) 0045 find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS AndroidExtras Xml) 0046 elseif(UNIX) 0047 find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED COMPONENTS Contacts People) 0048 find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets) 0049 endif() 0050 0051 if(QUICK_COMPILER) 0052 find_package(Qt5QuickCompiler) 0053 set_package_properties(Qt5QuickCompiler PROPERTIES 0054 DESCRIPTION "Compile QML at build time" 0055 TYPE OPTIONAL) 0056 endif() 0057 0058 if(UNIX AND NOT APPLE AND NOT ANDROID) 0059 include(KDEInstallDirs) 0060 include(KDECMakeSettings) 0061 include(ECMInstallIcons) 0062 include(ECMAddAppIcon) 0063 endif() 0064 0065 include(KDECompilerSettings NO_POLICY_SCOPE) 0066 include(KDEClangFormat) 0067 include(ECMSetupVersion) 0068 include(ECMSourceVersionControl) 0069 include(FeatureSummary) 0070 0071 if(${ECM_SOURCE_UNDER_VERSION_CONTROL}) 0072 execute_process( 0073 COMMAND git rev-parse --abbrev-ref HEAD 0074 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 0075 OUTPUT_VARIABLE GIT_BRANCH 0076 OUTPUT_STRIP_TRAILING_WHITESPACE) 0077 0078 # Get the latest abbreviated commit hash of the working branch 0079 execute_process( 0080 COMMAND git log -1 --format=%h 0081 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 0082 OUTPUT_VARIABLE GIT_COMMIT_HASH 0083 OUTPUT_STRIP_TRAILING_WHITESPACE) 0084 0085 add_definitions(-DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}") 0086 add_definitions(-DGIT_BRANCH="${GIT_BRANCH}") 0087 0088 else() 0089 add_definitions(-DGIT_COMMIT_HASH="${COMMUNICATOR_VERSION}") 0090 add_definitions(-DGIT_BRANCH="Stable") 0091 endif() 0092 0093 ecm_setup_version(${COMMUNICATOR_VERSION} 0094 VARIABLE_PREFIX COMMUNICATOR 0095 VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/communicator_version.h") 0096 0097 add_subdirectory(src) 0098 0099 ki18n_install(po) 0100 0101 if(UNIX AND NOT APPLE AND NOT ANDROID) 0102 install(TARGETS ${PROJECT_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 0103 install(FILES org.kde.communicator.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) 0104 install(FILES org.kde.communicator.json DESTINATION /usr/share/maui-accounts/manifests) 0105 install(FILES org.kde.communicator.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) 0106 endif() 0107 0108 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) 0109 0110 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) 0111 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})