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

# KDE Application Version, managed by release script
4
5
set(KDE_APPLICATIONS_VERSION_MAJOR "20")
set(KDE_APPLICATIONS_VERSION_MINOR "03")
6
7
8
9
10
set(KDE_APPLICATIONS_VERSION_MICRO "70")
set(KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")

project(kblocks VERSION ${KDE_APPLICATIONS_VERSION})

11
12
set (QT_MIN_VERSION "5.7.0")
set (KF5_MIN_VERSION "5.30.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})

Frederik Schwarzer's avatar
Frederik Schwarzer committed
17
18
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg Network)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
19
20
21
    Config
    ConfigWidgets
    CoreAddons
Frederik Schwarzer's avatar
Frederik Schwarzer committed
22
    Crash
Albert Astals Cid's avatar
Albert Astals Cid committed
23
    DocTools
24
    DBusAddons
Laurent Montel's avatar
Laurent Montel committed
25
    I18n
26
    WidgetsAddons
Laurent Montel's avatar
Laurent Montel committed
27
    XmlGui
Frederik Schwarzer's avatar
Frederik Schwarzer committed
28
)
Laurent Montel's avatar
Laurent Montel committed
29

30
find_package(KF5KDEGames 7.1.0 REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
31
32
33
34

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

add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
42
43
44
45
if (${KF5Config_VERSION} STRGREATER "5.56.0")
        add_definitions(-DQT_NO_FOREACH)
        MESSAGE(STATUS "compile without foreach")
endif()
46
47
48
49
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
endif()
50

Frederik Schwarzer's avatar
Frederik Schwarzer committed
51
add_subdirectory(themes)
Julian Helfferich's avatar
Julian Helfferich committed
52
add_subdirectory(sounds)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
53
add_subdirectory(doc)
54
55
56
57


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

Matthias Klumpp's avatar
Matthias Klumpp committed
58
59
60
61
62
63
64
65
66
67
68
69
set(kblocks_SRCS
   main.cpp
   KBlocksDefine.cpp
   KBlocksNetServer.cpp
   KBlocksNetClient.cpp
   KBlocksConfigManager.cpp
   KBlocksWin.cpp
   KBlocksDisplay.cpp
   KBlocksRepWin.cpp
   KBlocksAppThread.cpp
   KBlocksScene.cpp
   KBlocksView.cpp
70
   KBlocksScore.cpp
Matthias Klumpp's avatar
Matthias Klumpp committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
   KBlocksGraphics.cpp
   KBlocksSound.cpp
   KBlocksItemGroup.cpp
   KBlocksSvgItem.cpp
   KBlocksAnimator.cpp
   KBlocksAnimFade.cpp
   KBlocksAnimDrop.cpp
   KBlocksPlayManager.cpp
   KBlocksPlayNetwork.cpp
   KBlocksSinglePlayer.cpp
   KBlocksNetPlayer.cpp
   KBlocksKeyboardPlayer.cpp
   KBlocksDummyAI.cpp
   KBlocksLayout.cpp
   KBlocksGameLogic.cpp
   KBlocksSingleGame.cpp
   KBlocksField.cpp
   KBlocksPiece.cpp
   KBlocksPieceGenerator.cpp
   KBlocksGameMessage.cpp
   KBlocksGameRecorder.cpp
   KBlocksGameReplayer.cpp
   AI/KBlocksAIPlayer.cpp
   AI/KBlocksAIPlanner.cpp
   AI/KBlocksAIPlannerExtend.cpp
   AI/KBlocksAIEvaluation.cpp
   AI/KBlocksAIFeature.cpp
Frederik Schwarzer's avatar
Frederik Schwarzer committed
98
   AI/KBlocksAILog.cpp
99
   utils.cpp
Frederik Schwarzer's avatar
Frederik Schwarzer committed
100
)
101

102
ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX KBLOCKS VERSION_HEADER kblocks_version.h)
103
104
105
106
107
108

ecm_qt_declare_logging_category(kblocks_SRCS HEADER kblocks_ai_debug.h IDENTIFIER KBlocksAI CATEGORY_NAME KBlocks.AI)
ecm_qt_declare_logging_category(kblocks_SRCS HEADER kblocks_sound_debug.h IDENTIFIER KBSound CATEGORY_NAME KBlocks.Sound)
ecm_qt_declare_logging_category(kblocks_SRCS HEADER kblocks_replay_debug.h IDENTIFIER KBReplay CATEGORY_NAME KBlocks.Replay)
ecm_qt_declare_logging_category(kblocks_SRCS HEADER kblocks_graphics_debug.h IDENTIFIER KBGraphics CATEGORY_NAME KBlocks.Graphics)

Laurent Montel's avatar
Laurent Montel committed
109
kconfig_add_kcfg_files(kblocks_SRCS settings.kcfgc )
110

Laurent Montel's avatar
Laurent Montel committed
111
file(GLOB ICONS_SRCS "*-apps-kblocks.png")
112
ecm_add_app_icon(kblocks_SRCS ICONS ${ICONS_SRCS})
113

Laurent Montel's avatar
Laurent Montel committed
114
add_executable(kblocks ${kblocks_SRCS})
115

Frederik Schwarzer's avatar
Frederik Schwarzer committed
116
117
118
119
120
target_link_libraries(kblocks
    KF5KDEGames
    KF5KDEGamesPrivate
    Qt5::Network
    KF5::Crash
121
    KF5::DBusAddons
Frederik Schwarzer's avatar
Frederik Schwarzer committed
122
123
124
125
    KF5::XmlGui
    KF5::I18n
    Qt5::Svg
)
126

127
install(TARGETS kblocks  ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
128
129
130

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

Frederik Schwarzer's avatar
Frederik Schwarzer committed
131
install(PROGRAMS org.kde.kblocks.desktop  DESTINATION  ${KDE_INSTALL_APPDIR})
Rex Dieter's avatar
Rex Dieter committed
132
install(FILES org.kde.kblocks.appdata.xml DESTINATION  ${KDE_INSTALL_METAINFODIR})
Frederik Schwarzer's avatar
Frederik Schwarzer committed
133
134
135
install(FILES kblocks.kcfg  DESTINATION  ${KDE_INSTALL_KCFGDIR})
install(FILES kblocksui.rc  DESTINATION  ${KDE_INSTALL_KXMLGUI5DIR}/kblocks)
install(FILES kblocks.knsrc  DESTINATION  ${KDE_INSTALL_CONFDIR})
136

Frederik Schwarzer's avatar
Frederik Schwarzer committed
137
ecm_install_icons(ICONS 128-apps-kblocks.png  16-apps-kblocks.png  22-apps-kblocks.png  32-apps-kblocks.png  48-apps-kblocks.png  64-apps-kblocks.png DESTINATION ${KDE_INSTALL_ICONDIR} THEME hicolor)
138

139
140
141
142
143
if (${ECM_VERSION} STRGREATER "5.58.0")
    install(FILES kblocks.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
else()
    install(FILES kblocks.categories  DESTINATION ${KDE_INSTALL_CONFDIR})
endif()
144

145
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)