Warning, /utilities/skanpage/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2015 by Kåre Särs <kare.sars@iki .fi>
0002 # SPDX-FileCopyrightText: 2020 Alexander Stippich <a.stippich@gmx.net>
0003 #
0004 # SPDX-License-Identifier: BSD-2-Clause
0005 
0006 cmake_minimum_required(VERSION 3.16)
0007 
0008 # KDE Gear version, managed by release script
0009 set (RELEASE_SERVICE_VERSION_MAJOR "22")
0010 set (RELEASE_SERVICE_VERSION_MINOR "08")
0011 set (RELEASE_SERVICE_VERSION_MICRO "1")
0012 
0013 set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0014 
0015 project(skanpage
0016         VERSION ${RELEASE_SERVICE_VERSION}
0017         LANGUAGES CXX)
0018 
0019 set(REQUIRED_QT_VERSION "5.15.2")
0020 set(REQUIRED_KF5_VERSION "5.94")
0021 
0022 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0023 set(CMAKE_CXX_STANDARD 17)
0024 
0025 find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE)
0026 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
0027 include(FeatureSummary)
0028 include(ECMSetupVersion)
0029 include(ECMGenerateHeaders)
0030 include(ECMQtDeclareLoggingCategory)
0031 include(KDEInstallDirs)
0032 include(KDECompilerSettings)
0033 include(KDEClangFormat)
0034 include(KDECMakeSettings)
0035 include(ECMAddAppIcon)
0036 include(ECMInstallIcons)
0037 
0038 find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Qml QuickControls2 Concurrent Widgets Quick PrintSupport)
0039 
0040 find_package(KF5 ${REQUIRED_KF5_VERSION} REQUIRED
0041     COMPONENTS
0042         CoreAddons
0043         I18n
0044         Kirigami2
0045         Crash
0046         Config
0047         Purpose
0048 )
0049 
0050 find_package(KSaneCore "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}" REQUIRED)
0051 
0052 find_package(Tesseract 4)
0053 find_package(Leptonica)
0054 
0055 if (LEPTONICA_FOUND AND TESSERACT_FOUND)
0056    set(OCR_AVAILABLE 1)
0057    set(CMAKE_CXX_FLAGS "-fopenmp")
0058 else()
0059    message(STATUS "Skanpage will be built without OCR as libraries are missing.")
0060 endif()
0061 
0062 add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
0063 add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
0064 
0065 ecm_setup_version(${PROJECT_VERSION}
0066     VARIABLE_PREFIX SKANPAGE
0067     VERSION_HEADER skanpage_version.h)
0068 
0069 install(PROGRAMS org.kde.skanpage.desktop DESTINATION ${KDE_INSTALL_APPDIR})
0070 install(FILES org.kde.skanpage.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
0071 
0072 include_directories(${CMAKE_CURRENT_BINARY_DIR})
0073 
0074 configure_file(config-skanpage.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-skanpage.h)
0075 
0076 add_subdirectory(src)
0077 add_subdirectory(icons)
0078 #add_subdirectory(autotests)
0079 
0080 ki18n_install(po)
0081 
0082 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)