CMakeLists.txt 1.98 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2

Laurent Montel's avatar
Laurent Montel committed
3
project(kdf)
4

5
# KDE Application Version, managed by release script
6
set (RELEASE_SERVICE_VERSION_MAJOR "21")
7
set (RELEASE_SERVICE_VERSION_MINOR "07")
8
9
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
10

11
12
13
14
if(NOT UNIX)
  message(FATAL_ERROR "kdf is only supposed to be built on Unix platforms.")
endif(NOT UNIX)

Laurent Montel's avatar
Laurent Montel committed
15
16
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.82.0")
17

Laurent Montel's avatar
Laurent Montel committed
18
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
19
20
21
22
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)

include(ECMGenerateHeaders)
include(ECMInstallIcons)
23
include(ECMQtDeclareLoggingCategory)
24
25
26
27
28
29
30
include(ECMSetupVersion)
include(GenerateExportHeader)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

31
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KDF
32
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/kdf_version.h"
33
34
)

35
36
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KDFPRIVATE
    SOVERSION ${RELEASE_SERVICE_VERSION_MAJOR}
37
38
)

39
40
41
42
43
44
45
46
47
48
49
50
51
52
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
    Core
    Gui
    Widgets
)

find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
    ConfigWidgets
    CoreAddons
    DocTools
    I18n
    IconThemes
    KIO
    KCMUtils
53
    Notifications
54
55
56
    WidgetsAddons
    XmlGui
)
57

58
59
60
61
add_definitions(
    -DQT_NO_FOREACH
    -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
)
Laurent Montel's avatar
Laurent Montel committed
62
63
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)

64
65
66
67
if (CMAKE_UNITY_BUILD)
	add_definitions(-DCMAKE_UNITY_BUILD)
endif()

68
add_subdirectory(desktop)
69
add_subdirectory(doc)
70
add_subdirectory(pics)
71
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
72
73
74
75
76
ecm_qt_install_logging_categories(
	EXPORT KDF
        FILE kdf.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
77
78
79
80
ki18n_install(po)
kdoctools_install(po)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)