CMakeLists.txt 1.46 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.0)

Lukáš Tinkl's avatar
Lukáš Tinkl committed
3
project(bluedevil)
4
set(PROJECT_VERSION "5.20.80")
David Rosca's avatar
David Rosca committed
5
set(PROJECT_VERSION_MAJOR 5)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
6

7
set(QT_MIN_VERSION "5.15.0")
8
set(KF5_MIN_VERSION "5.74")
9

Nicolas Fella's avatar
Nicolas Fella committed
10
11
12
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

13
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Nicolas Fella's avatar
Nicolas Fella committed
14
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
David Rosca's avatar
David Rosca committed
15
16
17
18

find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
    Widgets
David Rosca's avatar
David Rosca committed
19
    Qml
David Rosca's avatar
David Rosca committed
20
21
    DBus)

22
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
David Rosca's avatar
David Rosca committed
23
24
25
    CoreAddons
    WidgetsAddons
    DBusAddons
David Rosca's avatar
David Rosca committed
26
    Notifications
27
    WindowSystem
David Rosca's avatar
David Rosca committed
28
    IconThemes
David Rosca's avatar
David Rosca committed
29
    Plasma
David Rosca's avatar
David Rosca committed
30
    I18n
David Rosca's avatar
David Rosca committed
31
    KIO
Nicolas Fella's avatar
Nicolas Fella committed
32
    Declarative
Nicolas Fella's avatar
Nicolas Fella committed
33
34
    BluezQt
)
David Rosca's avatar
David Rosca committed
35
36

find_package(SharedMimeInfo REQUIRED)
David Rosca's avatar
David Rosca committed
37
38
39

include(KDEInstallDirs)
include(KDECMakeSettings)
David Rosca's avatar
David Rosca committed
40
include(KDECompilerSettings NO_POLICY_SCOPE)
David Rosca's avatar
David Rosca committed
41
42
include(ECMOptionalAddSubdirectory)
include(FeatureSummary)
43
include(KDEClangFormat)
Nicolas Fella's avatar
Nicolas Fella committed
44
include(ECMSetupVersion)
45
46
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
47
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054200)
48
endif()
afiestas's avatar
afiestas committed
49

Nicolas Fella's avatar
Nicolas Fella committed
50
51
52
53
54
ecm_setup_version(${PROJECT_VERSION}
    VARIABLE_PREFIX BLUEDEVIL
    VERSION_HEADER ${CMAKE_BINARY_DIR}/version.h
)

David Rosca's avatar
David Rosca committed
55
include_directories(${CMAKE_CURRENT_BINARY_DIR})
56
57

add_subdirectory(src)
David Rosca's avatar
David Rosca committed
58
59

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
60
61
62
63

# 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})