CMakeLists.txt 1.7 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16)
2

Lukáš Tinkl's avatar
Lukáš Tinkl committed
3
project(bluedevil)
4
set(PROJECT_VERSION "5.21.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.78")
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
    Plasma
David Rosca's avatar
David Rosca committed
29
    I18n
David Rosca's avatar
David Rosca committed
30
    KIO
Nicolas Fella's avatar
Nicolas Fella committed
31
    Declarative
Nicolas Fella's avatar
Nicolas Fella committed
32
33
    BluezQt
)
David Rosca's avatar
David Rosca committed
34
35

find_package(SharedMimeInfo REQUIRED)
David Rosca's avatar
David Rosca committed
36

Nate Graham's avatar
Nate Graham committed
37
38
39
40
41
find_package(KF5Kirigami2 ${KF5_MIN_VERSION} CONFIG)
set_package_properties(KF5Kirigami2 PROPERTIES
    TYPE RUNTIME
)

David Rosca's avatar
David Rosca committed
42
43
include(KDEInstallDirs)
include(KDECMakeSettings)
David Rosca's avatar
David Rosca committed
44
include(KDECompilerSettings NO_POLICY_SCOPE)
David Rosca's avatar
David Rosca committed
45
46
include(ECMOptionalAddSubdirectory)
include(FeatureSummary)
47
include(KDEClangFormat)
Nicolas Fella's avatar
Nicolas Fella committed
48
include(ECMSetupVersion)
49
50
51

add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054200)
afiestas's avatar
afiestas committed
52

53
54
55
56
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    include(KDEGitCommitHooks)
endif()

Nicolas Fella's avatar
Nicolas Fella committed
57
58
59
60
61
ecm_setup_version(${PROJECT_VERSION}
    VARIABLE_PREFIX BLUEDEVIL
    VERSION_HEADER ${CMAKE_BINARY_DIR}/version.h
)

David Rosca's avatar
David Rosca committed
62
include_directories(${CMAKE_CURRENT_BINARY_DIR})
63
64

add_subdirectory(src)
David Rosca's avatar
David Rosca committed
65
66

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
67
68
69
70

# 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})
71
72
73
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()