# SPDX-FileCopyrightText: 2020 Cahfofpai # SPDX-FileCopyrightText: 2020 Han Young # SPDX-License-Identifier: GPL-3.0-or-later cmake_minimum_required(VERSION 3.16) # KDE Applications version, managed by release script. set(RELEASE_SERVICE_VERSION_MAJOR "25") set(RELEASE_SERVICE_VERSION_MINOR "03") set(RELEASE_SERVICE_VERSION_MICRO "70") set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") project(kalk VERSION ${RELEASE_SERVICE_VERSION}) set(KF_MIN_VERSION "6.3.0") set(QT_MIN_VERSION "6.7.0") if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.") endif() include(FeatureSummary) # only enable QML debugging on debug builds set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ") find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH}) # only enable QML debugging on debug builds set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ") include(FeatureSummary) include(ECMSetupVersion) include(ECMGenerateHeaders) include(ECMPoQmTools) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEClangFormat) include(KDEGitCommitHooks) include(ECMDeprecationSettings) include(ECMQmlModule) ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX KALK VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/version.h ) find_package(PkgConfig REQUIRED) find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Widgets) find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami I18n CoreAddons Config UnitConversion ) qt_policy(SET QTP0001 NEW) pkg_search_module(QALCULATE libqalculate>4.7.0 REQUIRED IMPORTED_TARGET) if (ANDROID) find_package(Qt6 ${QT_MIN_VERSION} REQUIRED COMPONENTS Svg) find_package(OpenSSL REQUIRED) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle) endif() ecm_set_disabled_deprecation_versions(QT 6.8 KF 6.7.0 ) add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(autotests) endif() ki18n_install(po) if (ANDROID) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle) endif() install(PROGRAMS org.kde.kalk.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES org.kde.kalk.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES org.kde.kalk.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps/) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) # add clang-format target for all our real source files file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)