Warning, /network/angelfish/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2014-2015 Sebastian Kügler <sebas@kde.org> 0002 # SPDX-FileCopyrightText: 2020 Jonah Brüchert <jbb@kaidan.im> 0003 # 0004 # SPDX-License-Identifier: LGPL-2.0-or-later 0005 0006 cmake_minimum_required(VERSION 3.16.0) 0007 0008 # KDE Applications version, managed by release script. 0009 set(RELEASE_SERVICE_VERSION_MAJOR "24") 0010 set(RELEASE_SERVICE_VERSION_MINOR "04") 0011 set(RELEASE_SERVICE_VERSION_MICRO "70") 0012 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") 0013 0014 project(angelfish VERSION ${RELEASE_SERVICE_VERSION}) 0015 0016 set(KF_MIN_VERSION "5.240") 0017 set(QT_MIN_VERSION "6.4") 0018 set(QCORO_MIN_VERSION "0.7.0") 0019 0020 0021 set(CMAKE_CXX_STANDARD 20) 0022 set(CMAKE_CXX_STANDARD_REQUIRED ON) 0023 set(CMAKE_CXX_EXTENSIONS OFF) 0024 0025 option(BUILD_TESTING "Build test programs" ON) 0026 0027 ################# Disallow in-source build ################# 0028 0029 if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") 0030 message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.") 0031 endif() 0032 0033 include(FeatureSummary) 0034 0035 ################# set KDE specific information ################# 0036 0037 find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) 0038 0039 # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked 0040 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) 0041 0042 include(ECMSetupVersion) 0043 include(ECMGenerateHeaders) 0044 include(KDEInstallDirs) 0045 include(KDECMakeSettings) 0046 include(KDEClangFormat) 0047 include(ECMPoQmTools) 0048 include(ECMFindQmlModule) 0049 include(KDECompilerSettings NO_POLICY_SCOPE) 0050 0051 ecm_setup_version(${PROJECT_VERSION} 0052 VARIABLE_PREFIX ANGELFISH 0053 VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/version.h 0054 ) 0055 0056 ################# Find dependencies ################# 0057 0058 find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2 Sql Widgets) 0059 find_package(Qt6 ${QT_MIN_VERSION} OPTIONAL_COMPONENTS Feedback) 0060 find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami Purpose I18n Config CoreAddons DBusAddons WindowSystem Notifications OPTIONAL_COMPONENTS QQC2DesktopStyle) 0061 find_package(KF6KirigamiAddons 0.6 REQUIRED) 0062 set_package_properties(KF6QQC2DesktopStyle PROPERTIES TYPE RUNTIME) 0063 0064 # Necessary to support QtWebEngine installed in a different prefix than the rest of Qt (e.g flatpak) 0065 find_package(Qt6WebEngineCore REQUIRED) 0066 find_package(Qt6WebEngineQuick REQUIRED) 0067 0068 find_package(FutureSQL6 REQUIRED) 0069 find_package(QCoro6 ${QCORO_MIN_VERSION} REQUIRED COMPONENTS Core Quick) 0070 0071 # For adblocker 0072 find_package(Corrosion) 0073 set_package_properties(Corrosion PROPERTIES 0074 TYPE RECOMMENDED 0075 PURPOSE "Required to build the builtin adblocker" 0076 DESCRIPTION "CMake scripts to seamlessly build and link to targets using cargo" 0077 URL https://github.com/AndrewGaspar/corrosion 0078 ) 0079 0080 ################# Definitions to pass to the compiler ################# 0081 0082 add_definitions(-DQT_NO_FOREACH -DQT_NO_URL_CAST_FROM_STRING) 0083 kde_enable_exceptions() 0084 qcoro_enable_coroutines() 0085 0086 if (NOT Qt6Feedback_FOUND) 0087 message(WARNING "Qt Feedback dependency is not found.\n" 0088 "While it is optional since unmaintained, haptics feedback functionality is not supported without it.") 0089 endif() 0090 0091 ################# build and install ################# 0092 add_subdirectory(lib) 0093 add_subdirectory(src) 0094 if (BUILD_TESTING) 0095 add_subdirectory(autotests) 0096 endif() 0097 add_subdirectory(angelfish-webapp) 0098 0099 ki18n_install(po) 0100 0101 install(PROGRAMS org.kde.angelfish.desktop DESTINATION ${KDE_INSTALL_APPDIR}) 0102 install(FILES org.kde.angelfish.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) 0103 install(FILES org.kde.angelfish.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) 0104 0105 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) 0106 0107 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h lib/*.cpp lib/*.h angelfish-webapp/*.cpp angelfish-webapp/*.h) 0108 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})