CMakeLists.txt 2.46 KB
Newer Older
1
2
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:

3
cmake_minimum_required (VERSION 2.8.12)
4
5

project (PlasmaVault)
6

7
set(PROJECT_VERSION "5.19.80")
Jonathan Riddell's avatar
Jonathan Riddell committed
8
9
set(PROJECT_VERSION_MAJOR 5)

10
11
set (PLASMAVAULT_VERSION "0.1")

12
set (QT_MIN_VERSION 5.12.0)
13
14
15
16
17
18
19
20
21
22
23

# We don't build in-source
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
   message (
      FATAL_ERROR
      "plasmavault requires an out of source build. Please create a separate build directory and run 'cmake path_to_plasma [options]' there."
   )
endif ()

# Extra CMake stuff
include (FeatureSummary)
24
25

# KDE Frameworks
26
set (KF5_DEP_VERSION "5.70.0") # handled by release scripts
27
28

find_package (ECM ${KF5_DEP_VERSION}  NO_MODULE)
29
30
31
32
33
34
35
36
37
38
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} ${ECM_KDE_MODULE_DIR})

include (KDEInstallDirs)
include (KDECMakeSettings)
include (KDECompilerSettings)
include (GenerateExportHeader)
include (ECMGenerateHeaders)
39
include(KDEClangFormat)
40
41
# Qt
set (CMAKE_AUTOMOC ON)
42
find_package (
43
   Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
44
45
46
47
48
   COMPONENTS
      Core
      DBus
      Quick
      Widgets
49
   )
50

51
find_package (
52
   KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS
53
54
55
56
57
58
59
60
61
62
   Activities
   Config
   ConfigWidgets
   CoreAddons
   DBusAddons
   I18n
   KIO
   Plasma
   WidgetsAddons
   )
63
64
65
66
find_package (KF5NetworkManagerQt ${KF5_DEP_VERSION})
if (KF5NetworkManagerQt_FOUND)
    set (HAVE_NETWORKMANAGER TRUE)
endif()
67
find_package (KSysGuard REQUIRED)
68
69

include_directories (
70
71
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/common
72
73
74
75
76
77
78
79
   )

# Basic includes
include (CPack)

include (ECMPackageConfigHelpers)
include (ECMSetupVersion)

80
81
add_definitions (-DQT_NO_URL_CAST_FROM_STRING)
add_definitions (-DQT_NO_CAST_TO_ASCII)
Ivan Čukić's avatar
Ivan Čukić committed
82
add_definitions (-DTRANSLATION_DOMAIN=\"plasmavault-kde\")
83
84
85
86
87
88
89
90
add_definitions (-fexceptions)
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po")
    ki18n_install (po)
endif ()

# libPlasmaVault

add_subdirectory (kded)
91
add_subdirectory (plasma)
92
add_subdirectory (icons)
93
add_subdirectory (fileitemplugin)
94

95
96
97
98
# 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})

99
100
101
# Write out the features
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)