forked from DesktopECHO/kactivitymanagerd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (63 loc) · 2.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
cmake_minimum_required (VERSION 3.0)
project (KActivityManagerd)
option (KACTIVITIES_ENABLE_EXCEPTIONS "If you have Boost 1.53, you need to build KActivities with exceptions enabled. This is UNTESTED and EXPERIMENTAL!" OFF)
set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.66.0")
# We don't build in-source
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message (
FATAL_ERROR
"kactivities require an out of source build. Please create a separate build directory and run 'cmake path_to_plasma [options]' there."
)
endif ()
set (KACTIVITIES_CURRENT_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Extra CMake stuff
include(FeatureSummary)
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE)
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules")
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
include (KDEInstallDirs)
include (KDECMakeSettings)
include (KDECompilerSettings NO_POLICY_SCOPE)
include (GenerateExportHeader)
include (ECMGenerateHeaders)
include (ECMQtDeclareLoggingCategory)
include (ECMSetupQtPluginMacroNames)
include(KDEClangFormat)
# C++17
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
# Qt
find_package (Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core DBus Widgets)
# KDE Frameworks
find_package (KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
# Basic includes
include (CPack)
# Adding local CMake modules
set (
CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
${CMAKE_MODULE_PATH}
)
add_definitions(
-DQT_NO_URL_CAST_FROM_STRING
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
)
add_definitions (-DTRANSLATION_DOMAIN=\"kactivities5\")
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
ki18n_install (po)
endif ()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_VISIBILITY_PRESET default)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 0)
endif ()
add_subdirectory (src)
# 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})
install(FILES kactivitymanagerd.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
# Write out the features
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)