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

Carl Schwan's avatar
Carl Schwan committed
3 4 5 6 7 8 9
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "21")
set (RELEASE_SERVICE_VERSION_MINOR "03")
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")

project(kontrast VERSION ${RELEASE_SERVICE_VERSION})
Carl Schwan's avatar
Carl Schwan committed
10

11 12 13
set(QT_MIN_VERSION "5.14.0")
set(KF5_MIN_VERSION "5.70.0")

Carl Schwan's avatar
Carl Schwan committed
14 15 16
include(FeatureSummary)

################# set KDE specific information #################
17
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Carl Schwan's avatar
Carl Schwan committed
18 19 20 21 22 23 24 25 26 27

# 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)
28
include(KDEClangFormat)
Carl Schwan's avatar
Carl Schwan committed
29

Carl Schwan's avatar
Carl Schwan committed
30 31 32
ecm_setup_version(${PROJECT_VERSION}
    VARIABLE_PREFIX KONTRAST
    SOVERSION ${PROJECT_VERSION_MAJOR}
Carl Schwan's avatar
Carl Schwan committed
33
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/config-kontrast.h"
Carl Schwan's avatar
Carl Schwan committed
34 35
)

Carl Schwan's avatar
Carl Schwan committed
36
################# Find dependencies #################
37
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Gui Qml QuickControls2 Svg Sql DBus)
Carl Schwan's avatar
Carl Schwan committed
38
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n CoreAddons Declarative)
Carl Schwan's avatar
Carl Schwan committed
39 40

################# build and install #################
41 42 43 44 45
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)

46 47
add_subdirectory(src)

Carl Schwan's avatar
Carl Schwan committed
48 49
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
50
install(FILES org.kde.kontrast.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)
Carl Schwan's avatar
Carl Schwan committed
51 52

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
53

Carl Schwan's avatar
Carl Schwan committed
54 55 56 57 58 59 60 61 62 63 64 65 66
if(ANDROID)
    kirigami_package_breeze_icons(ICONS
        go-home
        favorite
        help-symbolic
        help-about-symbolic
        applications-graphics
        color-picker
        reverse
        randomize
    )
endif()

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