CMakeLists.txt 1.79 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

Carl Schwan's avatar
Carl Schwan committed
24
25
26
ecm_setup_version(${PROJECT_VERSION}
    VARIABLE_PREFIX KONTRAST
    SOVERSION ${PROJECT_VERSION_MAJOR}
Carl Schwan's avatar
Carl Schwan committed
27
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/config-kontrast.h"
Carl Schwan's avatar
Carl Schwan committed
28
29
)

Carl Schwan's avatar
Carl Schwan committed
30
################# Find dependencies #################
31
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg Sql)
Carl Schwan's avatar
Carl Schwan committed
32
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n CoreAddons Declarative)
Carl Schwan's avatar
Carl Schwan committed
33
34

################# build and install #################
35
36
37
38
39
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)

40
41
add_subdirectory(src)

Carl Schwan's avatar
Carl Schwan committed
42
43
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
44
install(FILES org.kde.kontrast.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
Carl Schwan's avatar
Carl Schwan committed
45
46

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
47
48
49
50

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