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

Laurent Montel's avatar
Laurent Montel committed
3 4 5
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")

Laurent Montel's avatar
Laurent Montel committed
6
find_package(ECM 1.7.0 REQUIRED CONFIG)
Laurent Montel's avatar
Laurent Montel committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Qml Quick QuickWidgets Svg Test)
find_package(KF5 REQUIRED COMPONENTS 
    CoreAddons
    Config
    ItemModels
    WidgetsAddons
    WindowSystem
    Config
    DBusAddons
    I18n
    ConfigWidgets
    TextWidgets
    XmlGui
    KIO
    NotifyConfig
    NewStuff
Laurent Montel's avatar
Laurent Montel committed
25 26
    KDELibs4Support
    )
Laurent Montel's avatar
Laurent Montel committed
27 28 29 30 31 32 33

find_package(KF5KDEGames 4.9.0 REQUIRED)
find_package(Phonon4Qt5 CONFIG REQUIRED)

include_directories(BEFORE ${PHONON_INCLUDES})

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

add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
41
add_definitions(-DTRANSLATION_DOMAIN="ksnakeduel")
42 43


Stas Verberkt's avatar
Stas Verberkt committed
44
add_subdirectory(pics)
45
add_subdirectory(themes)
46
add_subdirectory(doc)
Stas Verberkt's avatar
Stas Verberkt committed
47 48 49

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

Jonathan Riddell's avatar
Jonathan Riddell committed
50
set(ksnakeduel_SRCS
Laurent Montel's avatar
Laurent Montel committed
51
        ksnakeduel_debug.cpp
52
	renderer.cpp
53
	object.cpp
54
	snakepart.cpp
55
	item.cpp
56
	obstacle.cpp
Stas Verberkt's avatar
Stas Verberkt committed
57
	playfield.cpp
Stas Verberkt's avatar
Stas Verberkt committed
58
	player.cpp
59 60
	intelligence.cpp
	tron.cpp
Stas Verberkt's avatar
Stas Verberkt committed
61 62
	ktron.cpp
	main.cpp)
Stas Verberkt's avatar
Stas Verberkt committed
63

Jonathan Riddell's avatar
Jonathan Riddell committed
64
ki18n_wrap_ui(ksnakeduel_SRCS general.ui)
Stas Verberkt's avatar
Stas Verberkt committed
65

Jonathan Riddell's avatar
Jonathan Riddell committed
66
kconfig_add_kcfg_files(ksnakeduel_SRCS settings.kcfgc)
67

68 69
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pics/hi*-apps-ksnakeduel.png")
ecm_add_app_icon(ksnakeduel_SRCS ICONS ${ICONS_SRCS})
Christian Ehrlicher's avatar
Christian Ehrlicher committed
70

Jonathan Riddell's avatar
Jonathan Riddell committed
71
add_executable(ksnakeduel ${ksnakeduel_SRCS})
72

Laurent Montel's avatar
Laurent Montel committed
73
target_link_libraries(ksnakeduel KF5KDEGames KF5KDEGamesPrivate  KF5::NotifyConfig KF5::I18n Qt5::Svg KF5::GuiAddons KF5::KDELibs4Support)
74

Laurent Montel's avatar
Laurent Montel committed
75
install(TARGETS ksnakeduel ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
76 77 78

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

79
install(PROGRAMS  org.kde.ksnakeduel.desktop DESTINATION ${KDE_INSTALL_APPDIR})
Laurent Montel's avatar
Laurent Montel committed
80 81 82
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})
83 84

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)