CMakeLists.txt 2.42 KB
Newer Older
Ivan Čukić's avatar
Ivan Čukić committed
1
2
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:

3
cmake_minimum_required (VERSION 3.0)
Ivan Čukić's avatar
Ivan Čukić committed
4

5
project (KActivityManagerd)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
6

7
8
option (KACTIVITIES_ENABLE_EXCEPTIONS "If you have Boost 1.53, you need to build KActivities with exceptions enabled. This is UNTESTED and EXPERIMENTAL!" OFF)

9
set(QT_MIN_VERSION "5.12.0")
10
set(KF5_MIN_VERSION "5.66.0")
11

Ivan Čukić's avatar
Ivan Čukić committed
12
13
14
15
16
17
18
# 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 ()
19

20
21
set (KACTIVITIES_CURRENT_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

Ivan Čukić's avatar
Ivan Čukić committed
22
# Extra CMake stuff
23
include(FeatureSummary)
24
find_package(ECM ${KF5_MIN_VERSION} NO_MODULE)
25
26
27
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)

28
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
29

30
31
include (KDEInstallDirs)
include (KDECMakeSettings)
32
include (KDECompilerSettings NO_POLICY_SCOPE)
33
34
include (GenerateExportHeader)
include (ECMGenerateHeaders)
35
include (ECMQtDeclareLoggingCategory)
36
include (ECMSetupQtPluginMacroNames)
37
include(KDEClangFormat)
38

Ivan Čukić's avatar
Ivan Čukić committed
39
# Qt
40
find_package (Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core DBus Widgets)
41

Ivan Čukić's avatar
Ivan Čukić committed
42
# KDE Frameworks
43
44
find_package (KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
45

46
47
# Basic includes
include (CPack)
48

Ivan Čukić's avatar
Ivan Čukić committed
49
# Adding local CMake modules
50
set (
Ivan Čukić's avatar
Ivan Čukić committed
51
52
53
   CMAKE_MODULE_PATH
   ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
   ${CMAKE_MODULE_PATH}
54
   )
55

56
57
58
59
add_definitions(
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_NO_SIGNALS_SLOTS_KEYWORDS
)
60
add_definitions (-DTRANSLATION_DOMAIN=\"kactivities5\")
61
62
63
64
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ki18n_install (po)
endif ()

Kevin Funk's avatar
Kevin Funk committed
65
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
66
67
68
69
   set(CMAKE_CXX_VISIBILITY_PRESET default)
   set(CMAKE_VISIBILITY_INLINES_HIDDEN 0)
endif ()

70
71
add_subdirectory (src)

72
73
74
75
# 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})

Laurent Montel's avatar
Laurent Montel committed
76
install(FILES kactivitymanagerd.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Ivan Čukić's avatar
Ivan Čukić committed
77
# Write out the features
Ivan Čukić's avatar
Ivan Čukić committed
78
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Ivan Čukić's avatar
Ivan Čukić committed
79