Commit 2ba94f6c authored by Nemanja Hiršl's avatar Nemanja Hiršl
Browse files

REVIEW:114974

Adding new option KONQUEST_EXAMPLE_PLAYER. If it is not set, it will
default to OFF and example player won't be added. If it is set, e.g.
-DKONQUEST_EXAMPLE_PLAYER=on two source files will be added to the list
of all program files and KONQUEST_EXAMPLE_PLAYER define propagated to
code as #define.
parent 7ff14ecd
......@@ -46,8 +46,6 @@ set(konquest_SRCS
players/ai/default/normal_gui.cpp
players/ai/default/hard.cpp
players/ai/default/hard_gui.cpp
players/ai/example/example.cpp
players/ai/example/example_gui.cpp
players/computerplayer.cpp
players/localplayer.cpp
players/localplayer_gui.cpp
......@@ -60,6 +58,15 @@ set(konquest_SRCS
view/standingswidget.cpp
)
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()
kde4_add_ui_files(konquest_SRCS dialogs/newGameDialog.ui )
kde4_add_app_icon(konquest_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/hi*-app-konquest.png")
......
......@@ -27,7 +27,9 @@
#include "../players/ai/default/weak_gui.h"
#include "../players/ai/default/normal_gui.h"
#include "../players/ai/default/hard_gui.h"
#ifdef KONQUEST_EXAMPLE_PLAYER
#include "../players/ai/example/example_gui.h"
#endif
#include "../players/computerplayer.h"
#include "../players/player_gui.h"
#include "../players/localplayer.h"
......@@ -331,7 +333,9 @@ NewGameDlg::NewGameDlg( QWidget *parent, Game *game)
m_selectablePlayer.push_back(new AiDefaultWeakGui());
m_selectablePlayer.push_back(new AiDefaultNormalGui());
m_selectablePlayer.push_back(new AiDefaultHardGui());
// m_selectablePlayer.push_back(new AiExampleGui());
#ifdef KONQUEST_EXAMPLE_PLAYER
m_selectablePlayer.push_back(new AiExampleGui());
#endif
m_selectablePlayer.push_back(new AiBecaiGui());
m_playerTypeChooser = new QMenu(this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment