CMakeLists.txt 3.02 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
project(konquest)
2

Laurent Montel's avatar
Laurent Montel committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
set (QT_MIN_VERSION "5.3.0")

find_package(ECM 1.3.0 REQUIRED CONFIG)
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
    KDELibs4Support)

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

include_directories(BEFORE ${PHONON_INCLUDES})

include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)

add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
add_definitions(-DTRANSLATION_DOMAIN="konquest")
40 41


Pierre Ducroquet's avatar
Pierre Ducroquet committed
42
add_subdirectory( pics )
43
add_subdirectory( doc )
44 45 46 47

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

set(konquest_SRCS 
Pierre Ducroquet's avatar
Pierre Ducroquet committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
    game.cpp
    localgame.cpp

    Konquest.cc
    planet.cc
    fleet.cc
    sector.cc
    mainwin.cc
    gameview.cc
    minimapview.cc

    map/map.cc
    map/mapview.cc
    map/mapscene.cc
    map/mapitems.cc

    dialogs/newgamedlg.cc
    dialogs/scoredlg.cc
    dialogs/fleetdlg.cc

68 69
    players/ai/becai/becai.cpp
    players/ai/becai/becai_gui.cpp
70 71 72 73 74 75 76
    players/ai/default/default.cpp
    players/ai/default/weak.cpp
    players/ai/default/weak_gui.cpp
    players/ai/default/normal.cpp
    players/ai/default/normal_gui.cpp
    players/ai/default/hard.cpp
    players/ai/default/hard_gui.cpp
Pierre Ducroquet's avatar
Pierre Ducroquet committed
77 78
    players/computerplayer.cpp
    players/localplayer.cpp
79
    players/localplayer_gui.cpp
Pierre Ducroquet's avatar
Pierre Ducroquet committed
80 81
    players/neutralplayer.cpp
    players/player.cpp
82
    players/player_gui.cpp
83 84
    players/spectatorplayer.cpp
    players/spectatorplayer_gui.cpp
85 86

    view/standingswidget.cpp
Pierre Ducroquet's avatar
Pierre Ducroquet committed
87 88
)

Nemanja Hiršl's avatar
Nemanja Hiršl committed
89 90 91 92 93 94 95 96 97
option(KONQUEST_EXAMPLE_PLAYER "Include example player" OFF)
if(KONQUEST_EXAMPLE_PLAYER)
    message(STATUS "KONQUEST_EXAMPLE_PLAYER")
    add_definitions(-DKONQUEST_EXAMPLE_PLAYER)
    list (APPEND konquest_SRCS
                 players/ai/example/example.cpp
                 players/ai/example/example_gui.cpp)
endif()

Laurent Montel's avatar
Laurent Montel committed
98
ki18n_wrap_ui(konquest_SRCS dialogs/newGameDialog.ui )
99

Laurent Montel's avatar
Laurent Montel committed
100
kde4_add_app_icon(konquest_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-apps-konquest.png")
Laurent Montel's avatar
Laurent Montel committed
101
add_executable(konquest ${konquest_SRCS})
102

Laurent Montel's avatar
Laurent Montel committed
103
target_link_libraries(konquest   KF5KDEGames KF5::KDELibs4Support Qt5::Svg)
104

105
install(TARGETS konquest  ${INSTALL_TARGETS_DEFAULT_ARGS} )
106 107 108 109


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

Laurent Montel's avatar
Laurent Montel committed
110
install( PROGRAMS org.kde.konquest.desktop  DESTINATION  ${XDG_APPS_INSTALL_DIR} )
Laurent Montel's avatar
Laurent Montel committed
111
install( FILES konquestui.rc  DESTINATION  ${KXMLGUI_INSTALL_DIR}/konquest )
112

Laurent Montel's avatar
Laurent Montel committed
113
ecm_install_icons( ICONS hi128-apps-konquest.png  hi16-apps-konquest.png  hi22-apps-konquest.png  hi32-apps-konquest.png  hi48-apps-konquest.png  hi64-apps-konquest.png DESTINATION ${ICON_INSTALL_DIR} )
114

Patrick Spendrin's avatar
Patrick Spendrin committed
115

116
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)