CMakeLists.txt 2.09 KB
Newer Older
Nicolás Alvarez's avatar
Nicolás Alvarez committed
1
# KTouch CMakeLists.txt file
Andreas Nicolai's avatar
Andreas Nicolai committed
2
#
3
# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "20")
5
set (RELEASE_SERVICE_VERSION_MINOR "11")
6 7
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
8 9


Laurent Montel's avatar
Laurent Montel committed
10
cmake_minimum_required(VERSION 3.5)
Wolfgang Bauer's avatar
Wolfgang Bauer committed
11 12 13
if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
   cmake_policy(VERSION 3.10)
endif()
14
project(ktouch VERSION ${RELEASE_SERVICE_VERSION})
Laurent Montel's avatar
Laurent Montel committed
15

Laurent Montel's avatar
Laurent Montel committed
16 17 18 19 20
set(QT_MIN_VERSION "5.11.0")
set(KF5_MIN_VERSION "5.46.0")


find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
21 22
find_package(KF5DocTools)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
23

24 25 26
include(KDEInstallDirs)
include(ECMAddTests)
include(KDECMakeSettings)
27
include(KDECompilerSettings NO_POLICY_SCOPE)
28 29 30 31 32
include(ECMInstallIcons)
include(ECMOptionalAddSubdirectory)
include(ECMSetupVersion)
include(FeatureSummary)

Laurent Montel's avatar
Laurent Montel committed
33
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS
34
    Core
35
    Gui
36 37 38
    Qml
    Quick
    QuickWidgets
Sebastian Gottfried's avatar
Sebastian Gottfried committed
39
    QuickControls2
40 41 42 43
    Sql
    Widgets
    Xml
    XmlPatterns
44 45
)

46
find_package(Qt5X11Extras)
47 48
find_package(Qt5 CONFIG QUIET OPTIONAL_COMPONENTS QuickCompiler)

Laurent Montel's avatar
Laurent Montel committed
49
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
50
    Completion
51 52 53 54
    Config
    ConfigWidgets
    CoreAddons
    Declarative
55
    DocTools
56 57 58
    I18n
    ItemViews
    KCMUtils
59 60
    TextWidgets
    WidgetsAddons
61
    WindowSystem
62
    XmlGui
Sebastian Gottfried's avatar
Sebastian Gottfried committed
63
    IconThemes
64
)
65

66

67
option(COMPILE_QML "Precompile QML code" OFF)
Antonio Rojas's avatar
Antonio Rojas committed
68

69 70 71
# enable QML debugging for debug builds
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG")

Andreas Nicolai's avatar
Andreas Nicolai committed
72
# subdirectories to build
73 74 75 76 77
ecm_optional_add_subdirectory(data)
ecm_optional_add_subdirectory(doc)
ecm_optional_add_subdirectory(src)
# ecm_optional_add_subdirectory(sounds)
ecm_optional_add_subdirectory(icons)
Andreas Nicolai's avatar
Andreas Nicolai committed
78 79

# files to install in the ktouch project root directory
Andreas Cord-Landwehr's avatar
Andreas Cord-Landwehr committed
80
ki18n_install(po)
81
install( PROGRAMS org.kde.ktouch.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
82
install(FILES org.kde.ktouch.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
83

84
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)