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

# KDE Application Version, managed by release script
4
set(RELEASE_SERVICE_VERSION_MAJOR "20")
5
set(RELEASE_SERVICE_VERSION_MINOR "11")
6 7
set(RELEASE_SERVICE_VERSION_MICRO "70")
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
8

9
project(kapman VERSION ${RELEASE_SERVICE_VERSION})
10

11 12
set (QT_MIN_VERSION "5.10.0")
set (KF5_MIN_VERSION "5.46.0")
Laurent Montel's avatar
Laurent Montel committed
13

14
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
Laurent Montel's avatar
Laurent Montel committed
15 16
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

Laurent Montel's avatar
Laurent Montel committed
17
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
18
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Laurent Montel's avatar
Laurent Montel committed
19 20
    CoreAddons
    Config
Frederik Schwarzer's avatar
Frederik Schwarzer committed
21
    Crash
Michael Palimaka's avatar
Michael Palimaka committed
22 23
    DBusAddons
    DocTools
Laurent Montel's avatar
Laurent Montel committed
24 25 26 27
    Config
    I18n
    ConfigWidgets
    XmlGui
28
    )
Laurent Montel's avatar
Laurent Montel committed
29 30 31 32 33 34

find_package(KF5KDEGames 4.9.0 REQUIRED)

include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
35
include(ECMSetupVersion)
36
include(KDECompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
37
include(KDECMakeSettings)
38
include(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
39

Frederik Schwarzer's avatar
Frederik Schwarzer committed
40 41 42 43 44 45 46 47 48
add_definitions(
    -DQT_USE_FAST_CONCATENATION
    -DQT_USE_FAST_OPERATOR_PLUS
    -DQT_NO_CAST_FROM_ASCII
    -DQT_NO_CAST_TO_ASCII
    -DQT_NO_CAST_FROM_BYTEARRAY
    -DQT_NO_URL_CAST_FROM_STRING
    -DQT_USE_QSTRINGBUILDER
)
49 50 51 52
if (${KF5Config_VERSION} STRGREATER "5.56.0")
        add_definitions(-DQT_NO_FOREACH)
        MESSAGE(STATUS "compile without foreach")
endif()
53

54 55
add_subdirectory(doc)

56
set(kapman_SRCS
Thomas Gallinari's avatar
Thomas Gallinari committed
57
	bonus.cpp
58 59 60 61 62
	cell.cpp
	character.cpp
	characteritem.cpp
	element.cpp
	elementitem.cpp
Johann Hingue's avatar
Johann Hingue committed
63
	energizer.cpp
64
	game.cpp
65
	gamescene.cpp
66
	gameview.cpp
67
	ghost.cpp
Thomas Gallinari's avatar
Thomas Gallinari committed
68
	ghostitem.cpp
69
	kapman.cpp
70
	kapmanitem.cpp
71
	kapmanmainwindow.cpp
Thomas Gallinari's avatar
Thomas Gallinari committed
72
	kapmanparser.cpp
73 74 75
	main.cpp
	maze.cpp
	mazeitem.cpp
Johann Hingue's avatar
Johann Hingue committed
76
	pill.cpp
Thomas Gallinari's avatar
Thomas Gallinari committed
77
)
78

79
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX KAPMAN VERSION_HEADER kapman_version.h)
80

Thomas Gallinari's avatar
Thomas Gallinari committed
81 82 83
file(GLOB themes
	"themes/*.svgz"
	"themes/*.desktop"
84
	"themes/*.copyright"
Thomas Gallinari's avatar
Thomas Gallinari committed
85
	"themes/*.png"
Thomas Gallinari's avatar
Thomas Gallinari committed
86
)
Laurent Montel's avatar
Laurent Montel committed
87
file(GLOB sounds_ogg "sounds/*.ogg")
Thomas Gallinari's avatar
Thomas Gallinari committed
88

Laurent Montel's avatar
Laurent Montel committed
89
kconfig_add_kcfg_files(kapman_SRCS settings.kcfgc)
Thomas Gallinari's avatar
Thomas Gallinari committed
90

Laurent Montel's avatar
Laurent Montel committed
91
ecm_install_icons(ICONS 128-apps-kapman.png  16-apps-kapman.png  22-apps-kapman.png  32-apps-kapman.png  48-apps-kapman.png  64-apps-kapman.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor)
Thomas Gallinari's avatar
Thomas Gallinari committed
92

Laurent Montel's avatar
Laurent Montel committed
93
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*-apps-kapman.png")
94
ecm_add_app_icon(kapman_SRCS ICONS ${ICONS_SRCS})
Laurent Montel's avatar
Laurent Montel committed
95
add_executable(kapman ${kapman_SRCS})
96

97 98 99 100 101
target_link_libraries(kapman 
   KF5KDEGames
   KF5KDEGamesPrivate
   Qt5::Svg
   Qt5::Xml
Frederik Schwarzer's avatar
Frederik Schwarzer committed
102
   KF5::Crash
103 104 105
   KF5::DBusAddons
   KF5::XmlGui
)
106

107 108
install(TARGETS kapman ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.kapman.desktop DESTINATION ${KDE_INSTALL_APPDIR})
109
install(FILES org.kde.kapman.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
110 111 112 113
install(FILES kapmanui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kapman)
install(FILES defaultmaze.xml DESTINATION ${KDE_INSTALL_DATADIR}/kapman)
install(FILES ${themes} DESTINATION ${KDE_INSTALL_DATADIR}/kapman/themes)
install(FILES ${sounds_ogg} DESTINATION ${KDE_INSTALL_SOUNDDIR}/kapman)
114 115

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)