CMakeLists.txt 2.12 KB
Newer Older
Jonathan Riddell's avatar
Jonathan Riddell committed
1
project(ksnakeduel)
2

Laurent Montel's avatar
Laurent Montel committed
3 4
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")
Frederik Schwarzer's avatar
Frederik Schwarzer committed
5
set (KF5_MIN_VERSION "5.15.0")
Laurent Montel's avatar
Laurent Montel committed
6

Laurent Montel's avatar
Laurent Montel committed
7
find_package(ECM 1.7.0 REQUIRED CONFIG)
Laurent Montel's avatar
Laurent Montel committed
8 9
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

10
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
Frederik Schwarzer's avatar
Frederik Schwarzer committed
11
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
12
    Completion
Laurent Montel's avatar
Laurent Montel committed
13
    Config
Frederik Schwarzer's avatar
Frederik Schwarzer committed
14 15 16
    ConfigWidgets
    CoreAddons
    Crash
Laurent Montel's avatar
Laurent Montel committed
17
    DBusAddons
18
    GuiAddons
Laurent Montel's avatar
Laurent Montel committed
19
    I18n
Frederik Schwarzer's avatar
Frederik Schwarzer committed
20 21 22 23
    KDELibs4Support
    WidgetsAddons
    XmlGui
)
Laurent Montel's avatar
Laurent Montel committed
24

25
find_package(KF5DocTools ${KF5_MIN_VERSION})
Laurent Montel's avatar
Laurent Montel committed
26

27
find_package(KF5KDEGames 4.9.0 REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
28 29

include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
30
include(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
31 32 33 34 35 36
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)

add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
37

Stas Verberkt's avatar
Stas Verberkt committed
38
add_subdirectory(pics)
39
add_subdirectory(themes)
40 41 42
if (KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()
Stas Verberkt's avatar
Stas Verberkt committed
43 44 45

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

Jonathan Riddell's avatar
Jonathan Riddell committed
46
set(ksnakeduel_SRCS
Frederik Schwarzer's avatar
Frederik Schwarzer committed
47 48 49 50 51 52 53 54 55 56 57 58 59
    ksnakeduel_debug.cpp
    renderer.cpp
    object.cpp
    snakepart.cpp
    item.cpp
    obstacle.cpp
    playfield.cpp
    player.cpp
    intelligence.cpp
    tron.cpp
    ktron.cpp
    main.cpp
)
Stas Verberkt's avatar
Stas Verberkt committed
60

Jonathan Riddell's avatar
Jonathan Riddell committed
61
ki18n_wrap_ui(ksnakeduel_SRCS general.ui)
Stas Verberkt's avatar
Stas Verberkt committed
62

Jonathan Riddell's avatar
Jonathan Riddell committed
63
kconfig_add_kcfg_files(ksnakeduel_SRCS settings.kcfgc)
64

Laurent Montel's avatar
Laurent Montel committed
65
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/*-apps-ksnakeduel.png")
66
ecm_add_app_icon(ksnakeduel_SRCS ICONS ${ICONS_SRCS})
Christian Ehrlicher's avatar
Christian Ehrlicher committed
67

Jonathan Riddell's avatar
Jonathan Riddell committed
68
add_executable(ksnakeduel ${ksnakeduel_SRCS})
69

Frederik Schwarzer's avatar
Frederik Schwarzer committed
70 71 72 73 74 75 76 77 78
target_link_libraries(ksnakeduel
    Qt5::Svg
    KF5::Crash
    KF5::GuiAddons
    KF5::I18n
    KF5::KDELibs4Support
    KF5KDEGames
    KF5KDEGamesPrivate
)
79

Laurent Montel's avatar
Laurent Montel committed
80
install(TARGETS ksnakeduel ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
81 82 83

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

84
install(PROGRAMS  org.kde.ksnakeduel.desktop DESTINATION ${KDE_INSTALL_APPDIR})
Laurent Montel's avatar
Laurent Montel committed
85 86 87
install(FILES  ksnakeduel.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(FILES  ksnakeduelui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/ksnakeduel)
install(FILES  ksnakeduel.knsrc DESTINATION ${KDE_INSTALL_CONFDIR})
88 89

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)