CMakeLists.txt 1.74 KB
Newer Older
1
project(khotkeys)
2
set(PROJECT_VERSION "5.17.80")
3
set(PROJECT_VERSION_MAJOR 5)
4
5

cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
6
set(QT_MIN_VERSION "5.12.0")
7
set(KF5_MIN_VERSION "5.62.0")
8
9


10
11
12
13
14
15
16

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/libkhotkeysprivate
    ${CMAKE_CURRENT_BINARY_DIR}/libkhotkeysprivate
    ${CMAKE_CURRENT_BINARY_DIR}
)

17
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
18
19
20
21
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

include(KDEInstallDirs)
include(KDECMakeSettings)
Laurent Montel's avatar
Laurent Montel committed
22
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
23
include(ECMPackageConfigHelpers)
24
include(ECMOptionalAddSubdirectory)
25
include(KDEClangFormat)
26

27
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
28
29
30
31
    GlobalAccel
    I18n
    KIO
    XmlGui
Laurent Montel's avatar
Laurent Montel committed
32
    KDELibs4Support
33
34
    DBusAddons
    KCMUtils
Àlex Fiestas's avatar
Àlex Fiestas committed
35
    Plasma
36
37
)

Àlex Fiestas's avatar
Àlex Fiestas committed
38
find_package(X11 REQUIRED)
39
find_package(LibKWorkspace CONFIG REQUIRED)
40

41
42
if(X11_FOUND)
    find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras )
43
    set(HAVE_XTEST ${X11_XTest_FOUND})
44
    set(HAVE_X11 1)
45
46
endif()

47
configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h)
48

49

Lasse Liehu's avatar
Lasse Liehu committed
50
51
52
# Set KI18n translation domain
add_definitions(-DTRANSLATION_DOMAIN=\"khotkeys\")

Michael Jansen's avatar
Michael Jansen committed
53
# Convenience library
54
add_subdirectory( libkhotkeysprivate )
55
56
# has to be before kcm_hotkeys
add_subdirectory( app )
Michael Jansen's avatar
Michael Jansen committed
57
# kcm module to configure hotkeys
58
add_subdirectory( kcm_hotkeys )
Michael Jansen's avatar
Michael Jansen committed
59
# kdedmodule and standalone demon for hotkeys
60
add_subdirectory( data )
61
add_subdirectory( test )
62
add_subdirectory( doc )
63
64
65
66
67

# 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
68
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)