CMakeLists.txt 1.98 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
Marco Martin's avatar
Marco Martin committed
2

3
set(PROJECT_VERSION "5.21.80")
4

Laurent Montel's avatar
Laurent Montel committed
5
project(systemsettings VERSION ${PROJECT_VERSION})
6
set(QT_MIN_VERSION "5.15.0")
7
set(KF5_MIN_VERSION "5.78")
8

Laurent Montel's avatar
Laurent Montel committed
9
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} )
11
12
13

include(KDEInstallDirs)
include(KDECMakeSettings)
14
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
15
include(KDEClangFormat)
16
include(GenerateExportHeader)
Marco Martin's avatar
Marco Martin committed
17
include(ECMQMLModules)
Laurent Montel's avatar
Laurent Montel committed
18
include(ECMQtDeclareLoggingCategory)
19
20
21
22
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    include(KDEGitCommitHooks)
endif()

23
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
24
25
26
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
Laurent Montel's avatar
Laurent Montel committed
27

28
29

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Marco Martin's avatar
Marco Martin committed
30
    Widgets Quick Qml QuickWidgets
31
)
32

33
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
34
    Crash
35
    ItemViews
36
    ItemModels
37
38
39
40
41
    KCMUtils
    I18n
    KIO
    Service
    IconThemes
42
    WidgetsAddons
43
44
45
46
    WindowSystem
    XmlGui
    DBusAddons
    Config
Laurent Montel's avatar
Laurent Montel committed
47
    DocTools
Marco Martin's avatar
Marco Martin committed
48
    Package
49
    Declarative
50
51
    Activities
    ActivitiesStats
52
    GuiAddons # UrlHanlder hanldes help:/ urls
53
    Kirigami2
54
    QUIET
55
)
56

Marco Martin's avatar
Marco Martin committed
57
58
ecm_find_qmlmodule(org.kde.kcm 1.0)

59
find_package(LibKWorkspace ${PROJECT_VERSION} CONFIG REQUIRED)
60

61
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
62

Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
63
64
65
66
add_subdirectory(core)
add_subdirectory(app)
add_subdirectory(categories)
add_subdirectory(icons)
67
add_subdirectory(sidebar)
68
69
add_subdirectory(doc)

Laurent Montel's avatar
Laurent Montel committed
70
ecm_qt_install_logging_categories(EXPORT SYSTEMSETTINGS FILE systemsettings.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
71

72
73
74
# 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})
75
76
77
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
78

79
80
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)