Warning, /plasma-mobile/kalk/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 #  This file is part of Kalk
0002 #
0003 #  Copyright (C) 2020 Cahfofpai
0004 #                     Han Young <hanyoung@protonmail.com>
0005 #
0006 #
0007 #  $BEGIN_LICENSE:GPL3+$
0008 #
0009 #  This program is free software: you can redistribute it and/or modify
0010 #  it under the terms of the GNU General Public License as published by
0011 #  the Free Software Foundation, either version 3 of the License, or
0012 #  (at your option) any later version.
0013 #
0014 #  This program is distributed in the hope that it will be useful,
0015 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 #  GNU General Public License for more details.
0018 #
0019 #  You should have received a copy of the GNU General Public License
0020 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 #
0022 #  $END_LICENSE$
0023 project(Kalk)
0024 
0025 set(PROJECT_VERSION "22.06")
0026 find_package(BISON REQUIRED)
0027 find_package(FLEX REQUIRED)
0028 
0029 cmake_minimum_required(VERSION 2.8.12)
0030 set(KF5_MIN_VERSION "5.89.0")
0031 set(QT_MIN_VERSION "5.15.0")
0032 if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
0033     message(FATAL_ERROR "This application requires an out of source build. Please
0034         create a separate build directory.")
0035 endif()
0036 
0037 include(FeatureSummary)
0038 
0039 # only enable QML debugging on debug builds
0040 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
0041 
0042 find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
0043 set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0044 set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" ${CMAKE_SOURCE_DIR}/cmake/modules)
0045 find_package(GMP)
0046 set_package_properties(GMP PROPERTIES
0047     DESCRIPTION "The GNU Multiple Precision Arithmetic Library"
0048     URL "https://gmplib.org/"
0049     TYPE REQUIRED
0050     PURPOSE "Required for building KCalc."
0051 )
0052 
0053 find_package(MPFR)
0054 set_package_properties(MPFR PROPERTIES
0055     DESCRIPTION "The GNU Multiple Precision Floating-Point Reliable Library"
0056     URL "https://www.mpfr.org/"
0057     TYPE REQUIRED
0058     PURPOSE "Required for building KCalc."
0059 )
0060 
0061 include(CheckTypeSize)
0062 include(CheckIncludeFiles)
0063 
0064 check_include_files(ieeefp.h     HAVE_IEEEFP_H)
0065 check_type_size("signed long"    SIZEOF_SIGNED_LONG)
0066 check_type_size("unsigned long"  SIZEOF_UNSIGNED_LONG)
0067 
0068 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
0069 
0070 # only enable QML debugging on debug builds
0071 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG ")
0072 
0073 include(FeatureSummary)
0074 include(ECMSetupVersion)
0075 include(ECMGenerateHeaders)
0076 include(ECMPoQmTools)
0077 include(KDEInstallDirs)
0078 include(KDECMakeSettings)
0079 include(KDECompilerSettings NO_POLICY_SCOPE)
0080 include(KDEClangFormat)
0081 include(KDEGitCommitHooks)
0082 
0083 ecm_setup_version(${PROJECT_VERSION}
0084     VARIABLE_PREFIX KALK
0085     VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/version.h
0086 )
0087 
0088 find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Widgets Feedback QuickCompiler)
0089 find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
0090         Config
0091         Kirigami2
0092         I18n
0093         CoreAddons
0094         UnitConversion)
0095 add_subdirectory(src)
0096 
0097 configure_file(config-kcalc.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcalc.h )
0098 add_subdirectory(knumber)
0099 
0100 if(BUILD_TESTING)
0101    add_subdirectory(autotests)
0102 endif()
0103 
0104 ki18n_install(po)
0105 
0106 install(PROGRAMS org.kde.kalk.desktop DESTINATION ${KDE_INSTALL_APPDIR})
0107 install(FILES org.kde.kalk.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
0108 install(FILES kalk.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps/)
0109 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
0110 
0111 # add clang-format target for all our real source files
0112 file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
0113 kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
0114 kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)