CMakeLists.txt 1.62 KB
Newer Older
1
cmake_minimum_required(VERSION 3.8)
Carl Schwan's avatar
Carl Schwan committed
2

3
project(kontrast VERSION "1.0.0")
Carl Schwan's avatar
Carl Schwan committed
4

5
6
7
set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.70.0")

Carl Schwan's avatar
Carl Schwan committed
8
9
10
include(FeatureSummary)

################# set KDE specific information #################
11
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Carl Schwan's avatar
Carl Schwan committed
12
13
14
15
16
17
18
19
20
21

# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMPoQmTools)
22
include(KDEClangFormat)
Carl Schwan's avatar
Carl Schwan committed
23
24

################# Find dependencies #################
25
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg Sql)
Carl Schwan's avatar
Carl Schwan committed
26
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n CoreAddons Declarative)
Carl Schwan's avatar
Carl Schwan committed
27
28

################# build and install #################
29
30
31
32
33
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)

34
35
add_subdirectory(src)

Carl Schwan's avatar
Carl Schwan committed
36
37
install(PROGRAMS org.kde.kontrast.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kontrast.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Carl Schwan's avatar
Carl Schwan committed
38
install(FILES org.kde.kontrast.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
Carl Schwan's avatar
Carl Schwan committed
39
40

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
41
42
43
44

file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})