CMakeLists.txt 2.49 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2

3
# Release Service version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "21")
5
set (RELEASE_SERVICE_VERSION_MINOR "07")
6
7
8
9
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_COMPACT_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}${RELEASE_SERVICE_VERSION_MINOR}${RELEASE_SERVICE_VERSION_MICRO}")

# Bump KSHISEN_BASE_VERSION once new features are added
Frederik Schwarzer's avatar
Frederik Schwarzer committed
10
set(KSHISEN_BASE_VERSION "1.11")
11
12
13
set(KSHISEN_VERSION "${KSHISEN_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}")

project(kshisen VERSION ${KSHISEN_VERSION})
14

15
16
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.83.0")
Raymond Wooninck's avatar
Raymond Wooninck committed
17

18
19
20
21
22
23
set(CMAKE_CXX_STANDARD 14) # C++14...
set(CMAKE_CXX_STANDARD_REQUIRED ON) # ...is required...
set(CMAKE_CXX_EXTENSIONS OFF) # ...without compiler extensions like gnu++14

# Found this somewhere but cannot re-find it now ... but want to investigate later, so keeping this here for now.
#set(CXX_CLANG_TIDY ON)
24

25
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Raymond Wooninck's avatar
Raymond Wooninck committed
26

27
28
29
if(ENABLE_CLAZY)
    set(CMAKE_CXX_COMPILER clazy)
endif()
30

31
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
Raymond Wooninck's avatar
Raymond Wooninck committed
32

33
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
34
35
36
37
38
39
40
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    Config
    Crash
    DBusAddons
    DocTools
    XmlGui
)
Raymond Wooninck's avatar
Raymond Wooninck committed
41

42
43
44
45
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)

Raymond Wooninck's avatar
Raymond Wooninck committed
46
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
47
include(ECMAddAppIcon)
Raymond Wooninck's avatar
Raymond Wooninck committed
48
include(ECMInstallIcons)
49
include(ECMQtDeclareLoggingCategory)
50
include(ECMSetupVersion)
Raymond Wooninck's avatar
Raymond Wooninck committed
51

52
find_package(KF5KMahjongglib 5.1.0 REQUIRED)
53
find_package(KF5KDEGames 7.3.0 REQUIRED)
54

Frederik Schwarzer's avatar
Frederik Schwarzer committed
55
add_definitions(
56
    -DQT_STRICT_ITERATORS
Frederik Schwarzer's avatar
Frederik Schwarzer committed
57
58
59
60
61
    -DQT_NO_CAST_FROM_ASCII
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_BYTEARRAY
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_USE_QSTRINGBUILDER
62
    -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
63
    -DQT_NO_FOREACH
64
    -DQT_NO_KEYWORDS
65
    -DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
66
    -DQT_DEPRECATED_WARNINGS_SINCE=0x060000
67
    -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055200
68
    -DKF_DEPRECATED_WARNINGS_SINCE=0x060000
Frederik Schwarzer's avatar
Frederik Schwarzer committed
69
)
70
71

add_subdirectory(src)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
72
add_subdirectory(icons)
73
74
75
76
77
78
add_subdirectory(sounds)
add_subdirectory(doc)

install(PROGRAMS org.kde.kshisen.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES org.kde.kshisen.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})

79
ki18n_install(po)
80
kdoctools_install(po)
81

Raymond Wooninck's avatar
Raymond Wooninck committed
82
########### Display Summary ###############
Frederik Schwarzer's avatar
Frederik Schwarzer committed
83
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)