CMakeLists.txt 2.01 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
2

3
project(KScreen)
4
set(PROJECT_VERSION "5.25.1")
5
set(KSCREEN_VERSION ${PROJECT_VERSION})
6

Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
7
add_definitions("-DKSCREEN_VERSION=\"${KSCREEN_VERSION}\"")
8

9
set(QT_MIN_VERSION "5.15.2")
10
set(KF5_MIN_VERSION "5.94")
11
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
12

Nicolas Fella's avatar
Nicolas Fella committed
13
14
15
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

16
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
17
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
18

19
20
include(KDEInstallDirs)
include(KDECMakeSettings)
21
include(KDECompilerSettings NO_POLICY_SCOPE)
22
23
24
25
include(ECMInstallIcons)
include(ECMMarkAsTest)
include(ECMQtDeclareLoggingCategory)
include(FeatureSummary)
26
include(KDEClangFormat)
27
include(KDEGitCommitHooks)
28

29
30
include_directories("${CMAKE_CURRENT_BINARY_DIR}")

31
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test Sensors)
32
33
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    Config
34
    DBusAddons
35
    Declarative
36
37
    GlobalAccel
    I18n
38
    IconThemes
39
    KCMUtils
40
    Plasma
41
    PlasmaQuick
42
    XmlGui
Sebastian Kügler's avatar
Sebastian Kügler committed
43
)
44

45
find_package(KF5Screen ${PROJECT_VERSION} REQUIRED)
46

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
find_package(X11)
set_package_properties(X11 PROPERTIES
    DESCRIPTION "X11 libraries"
    URL "https://www.x.org"
    PURPOSE "Required for building the X11 based workspace"
    TYPE REQUIRED
)

if(X11_FOUND)
  set(HAVE_X11 1)
  find_package(X11_XCB REQUIRED)
  find_package(XCB REQUIRED COMPONENTS XCB ATOM)
  find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()

configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)

64
add_subdirectory(kcm)
65
add_subdirectory(kded)
66
add_subdirectory(plasmoid)
Daniel Vrátil's avatar
Daniel Vrátil committed
67
add_subdirectory(tests)
Àlex Fiestas's avatar
Àlex Fiestas committed
68
add_subdirectory(console)
69

70
71
72
# 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})
73
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
74

Laurent Montel's avatar
Laurent Montel committed
75
ecm_qt_install_logging_categories(EXPORT KSCREEN FILE kscreen.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
76

77
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)