CMakeLists.txt 2.23 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 (KActivities)
Aaron J. Seigo's avatar
Aaron J. Seigo committed
6

7
8
9
option (KACTIVITIES_LIBRARY_ONLY "If true, compiles only the KActivities library, without the service and other modules." OFF)
option (KACTIVITIES_ENABLE_EXCEPTIONS "If you have Boost 1.53, you need to build KActivities with exceptions enabled. This is UNTESTED and EXPERIMENTAL!" OFF)

10
11
set(QT_MIN_VERSION "5.9.0")
set(KF5_MIN_VERSION "5.42.0")
12

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

21
22
set (KACTIVITIES_CURRENT_ROOT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

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

29
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
30

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

Ivan Čukić's avatar
Ivan Čukić committed
38
39
# Qt
set (CMAKE_AUTOMOC ON)
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
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
57
add_definitions (-DTRANSLATION_DOMAIN=\"kactivities5\")
58
59
60
61
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ki18n_install (po)
endif ()

Kevin Funk's avatar
Kevin Funk committed
62
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
63
64
65
66
   set(CMAKE_CXX_VISIBILITY_PRESET default)
   set(CMAKE_VISIBILITY_INLINES_HIDDEN 0)
endif ()

67
68
add_subdirectory (src)

Ivan Čukić's avatar
Ivan Čukić committed
69
# Write out the features
Ivan Čukić's avatar
Ivan Čukić committed
70
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
Ivan Čukić's avatar
Ivan Čukić committed
71