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

3
project(kgamma)
4
set(PROJECT_VERSION "5.20.80")
5

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

9
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}  ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
11

David Edmundson's avatar
David Edmundson committed
12
13
include(KDEInstallDirs)
include(KDECMakeSettings)
14
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
David Edmundson's avatar
David Edmundson committed
15
include(FeatureSummary)
16
include(KDEClangFormat)
17
18
19
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    include(KDEGitCommitHooks)
endif()
20

Michael Palimaka's avatar
Michael Palimaka committed
21
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets)
David Edmundson's avatar
David Edmundson committed
22

23
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
24
25
    Config
    ConfigWidgets
26
    DocTools
27
    I18n
David Edmundson's avatar
David Edmundson committed
28
)
29

30
find_package(X11 REQUIRED COMPONENTS xf86vmode)
31

Pino Toscano's avatar
Pino Toscano committed
32
# X11_xf86vmode discovery is done by FindX11
Hrvoje Senjan's avatar
Hrvoje Senjan committed
33
add_feature_info("X11_xf86vmode" X11_xf86vmode_FOUND "Required to build kgamma.")
34

David Edmundson's avatar
David Edmundson committed
35
# check_include_files(strstream HAVE_STRSTREAM_H)
Pino Toscano's avatar
Pino Toscano committed
36
configure_file(config-kgamma.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kgamma.h)
37

David Edmundson's avatar
David Edmundson committed
38
include_directories(${CMAKE_CURRENT_BINARY_DIR})
39
40
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
41
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054200)
42
endif()
43

Pino Toscano's avatar
Pino Toscano committed
44
add_subdirectory(kcmkgamma)
David Edmundson's avatar
David Edmundson committed
45
# add_subdirectory(xf86gammacfg)
Pino Toscano's avatar
Pino Toscano committed
46
add_subdirectory(doc)
47

48
49
50
# 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})
51
52
53
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
54

Hrvoje Senjan's avatar
Hrvoje Senjan committed
55
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)