CMakeLists.txt 2.61 KB
Newer Older
1
2
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)

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

# Bump KMAHJONGG_BASE_VERSION once new features are added
set(KMAHJONGG_BASE_VERSION "0.9")
set(KMAHJONGG_VERSION "${KMAHJONGG_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}")

project(kmahjongg VERSION ${KMAHJONGG_VERSION})
14

Albert Astals Cid's avatar
Albert Astals Cid committed
15
16
set(QT_MIN_VERSION "5.10.0")
set(KF5_MIN_VERSION "5.55.0")
Raymond Wooninck's avatar
Raymond Wooninck committed
17

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

20
21
22
23
if(ENABLE_CLAZY)
    set(CMAKE_CXX_COMPILER clazy)
endif()

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

26
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui Svg)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
27
28
29
30
31
32
33
34
35
36
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
    Config
    CoreAddons
    Crash
    DBusAddons
    Declarative
    DocTools
    NewStuff
    XmlGui
)
Raymond Wooninck's avatar
Raymond Wooninck committed
37

38
39
40
41
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)

Raymond Wooninck's avatar
Raymond Wooninck committed
42
include(FeatureSummary)
Thomas Branch's avatar
Thomas Branch committed
43
include(ECMAddAppIcon)
Raymond Wooninck's avatar
Raymond Wooninck committed
44
include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
45
include(ECMQtDeclareLoggingCategory)
46
include(ECMSetupVersion)
Raymond Wooninck's avatar
Raymond Wooninck committed
47
48
49

find_package(KF5KMahjongglib REQUIRED)
find_package(KF5KDEGames 4.9.0 REQUIRED)
50

51
add_definitions(
52
53
54
55
    -DQT_NO_CAST_FROM_ASCII
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_BYTEARRAY
    -DQT_NO_URL_CAST_FROM_STRING
56
    -DQT_USE_QSTRINGBUILDER
57
    -DQT_NO_KEYWORDS
58
59
60
61
62
63
    -DQT_STRICT_ITERATORS
    -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
    -DQT_DISABLE_DEPRECATED_BEFORE=0x050A00
    -DQT_DEPRECATED_WARNINGS_SINCE=0x060000
    -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x053700
    -DKF_DEPRECATED_WARNINGS_SINCE=0x060000
64
)
65
66
67
if (${KF5Config_VERSION} STRGREATER "5.56.0")
    add_definitions(-DQT_NO_FOREACH)
endif()
68

69
add_subdirectory(src)
70
add_subdirectory(icons)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
71
72
add_subdirectory(layouts)
add_subdirectory(doc)
73
74
75
76
77
78

########### next target ###############


########### install files ###############

Frederik Schwarzer's avatar
Frederik Schwarzer committed
79
install(PROGRAMS org.kde.kmahjongg.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})
80
install(FILES org.kde.kmahjongg.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
81
82
83
84
85
if (${ECM_VERSION} STRGREATER "5.58.0")
    install(FILES kmahjongg.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
else()
    install(FILES kmahjongg.categories  DESTINATION ${KDE_INSTALL_CONFDIR})
endif()
Laurent Montel's avatar
Laurent Montel committed
86

87
ki18n_install(po)
88
kdoctools_install(po)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
89

Raymond Wooninck's avatar
Raymond Wooninck committed
90
########### Display Summary ###############
Frederik Schwarzer's avatar
Frederik Schwarzer committed
91
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
Patrick Spendrin's avatar
Patrick Spendrin committed
92