switched from qmake to cmake

This commit is contained in:
Max-Wilhelm Bruker 2012-01-21 19:21:57 +01:00
parent 16541141bd
commit 3c24899de6
143 changed files with 643 additions and 1254 deletions

5
CMakeLists.txt Normal file
View file

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 2.6)
add_subdirectory(common)
add_subdirectory(servatrice)
add_subdirectory(cockatrice)
add_subdirectory(oracle)

191
cockatrice/CMakeLists.txt Normal file
View file

@ -0,0 +1,191 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
PROJECT(cockatrice)
SET(cockatrice_SOURCES
src/abstractcounter.cpp
src/counter_general.cpp
src/dlg_creategame.cpp
src/dlg_connect.cpp
src/dlg_create_token.cpp
src/abstractclient.cpp
src/remoteclient.cpp
src/main.cpp
src/window_main.cpp
src/gamesmodel.cpp
src/player.cpp
src/playertarget.cpp
src/cardzone.cpp
src/selectzone.cpp
src/cardlist.cpp
src/abstractcarditem.cpp
src/carditem.cpp
src/tablezone.cpp
src/handzone.cpp
src/handcounter.cpp
src/carddatabase.cpp
src/gameview.cpp
src/gameselector.cpp
src/decklistmodel.cpp
src/dlg_load_deck_from_clipboard.cpp
src/dlg_load_remote_deck.cpp
src/cardinfowidget.cpp
src/messagelogwidget.cpp
src/zoneviewzone.cpp
src/zoneviewwidget.cpp
src/pilezone.cpp
src/stackzone.cpp
src/carddragitem.cpp
src/carddatabasemodel.cpp
src/window_deckeditor.cpp
src/setsmodel.cpp
src/window_sets.cpp
src/abstractgraphicsitem.cpp
src/abstractcarddragitem.cpp
src/dlg_settings.cpp
src/dlg_cardsearch.cpp
src/phasestoolbar.cpp
src/gamescene.cpp
src/arrowitem.cpp
src/arrowtarget.cpp
src/tab.cpp
src/tab_server.cpp
src/tab_room.cpp
src/tab_message.cpp
src/tab_game.cpp
src/tab_deck_storage.cpp
src/tab_supervisor.cpp
src/tab_admin.cpp
src/tab_userlists.cpp
src/chatview.cpp
src/userlist.cpp
src/userinfobox.cpp
src/remotedecklist_treewidget.cpp
src/deckview.cpp
src/playerlistwidget.cpp
src/pixmapgenerator.cpp
src/settingscache.cpp
src/localserver.cpp
src/localserverinterface.cpp
src/localclient.cpp
src/priceupdater.cpp
src/soundengine.cpp
)
SET(cockatrice_HEADERS
src/abstractcounter.h
src/counter_general.h
src/dlg_creategame.h
src/dlg_connect.h
src/dlg_create_token.h
src/gamesmodel.h
src/abstractclient.h
src/remoteclient.h
src/window_main.h
src/cardzone.h
src/selectzone.h
src/player.h
src/playertarget.h
src/abstractcarditem.h
src/carditem.h
src/tablezone.h
src/handzone.h
src/handcounter.h
src/carddatabase.h
src/gameview.h
src/gameselector.h
src/decklistmodel.h
src/dlg_load_deck_from_clipboard.h
src/dlg_load_remote_deck.h
src/cardinfowidget.h
src/messagelogwidget.h
src/zoneviewzone.h
src/zoneviewwidget.h
src/pilezone.h
src/stackzone.h
src/carddragitem.h
src/carddatabasemodel.h
src/window_deckeditor.h
src/setsmodel.h
src/window_sets.h
src/abstractgraphicsitem.h
src/abstractcarddragitem.h
src/dlg_settings.h
src/dlg_cardsearch.h
src/phasestoolbar.h
src/gamescene.h
src/arrowitem.h
src/arrowtarget.h
src/tab.h
src/tab_server.h
src/tab_room.h
src/tab_message.h
src/tab_game.h
src/tab_deck_storage.h
src/tab_supervisor.h
src/tab_admin.h
src/tab_userlists.h
src/chatview.h
src/userlist.h
src/userinfobox.h
src/remotedecklist_treewidget.h
src/deckview.h
src/playerlistwidget.h
src/settingscache.h
src/localserver.h
src/localserverinterface.h
src/localclient.h
src/priceupdater.h
src/soundengine.h
src/pending_command.h
)
set(cockatrice_RESOURCES cockatrice.qrc)
set(cockatrice_TS
translations/cockatrice_cs.ts
translations/cockatrice_de.ts
translations/cockatrice_en.ts
translations/cockatrice_es.ts
translations/cockatrice_fr.ts
translations/cockatrice_it.ts
translations/cockatrice_ja.ts
translations/cockatrice_pl.ts
translations/cockatrice_pt-br.ts
translations/cockatrice_pt.ts
translations/cockatrice_ru.ts
translations/cockatrice_sk.ts
)
if(WIN32)
set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc)
endif(WIN32)
if(APPLE)
set(OSX_ICON_FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns)
set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set( cockatrice_SOURCES ${cockatrice_SOURCES} ${OSX_ICON_FILES} )
ENDIF(APPLE)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTSCRIPT TRUE)
SET(QT_USE_QTMULTIMEDIA TRUE)
SET(QT_USE_QTXML TRUE)
SET(QT_USE_QTSVG TRUE)
FIND_PACKAGE(Qt4 REQUIRED)
if (NOT QT_QTMULTIMEDIA_FOUND)
FIND_PACKAGE(QtMobility REQUIRED)
endif (NOT QT_QTMULTIMEDIA_FOUND)
FIND_PACKAGE(Protobuf REQUIRED)
set(CMAKE_BUILD_TYPE Release)
QT4_WRAP_CPP(cockatrice_HEADERS_MOC ${cockatrice_HEADERS})
QT4_ADD_TRANSLATION(${cockatrice_QM} ${cockatrice_TS})
QT4_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(../common)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../common)
INCLUDE_DIRECTORIES(${QT_MOBILITY_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR})
ADD_EXECUTABLE(cockatrice ${cockatrice_SOURCES} ${cockatrice_QM} ${cockatrice_RESOURCES_RCC} ${cockatrice_HEADERS_MOC})
TARGET_LINK_LIBRARIES(cockatrice cockatrice_common ${QT_LIBRARIES} ${QT_MOBILITY_MULTIMEDIAKIT_LIBRARY} ${PROTOBUF_LIBRARIES})

View file

@ -1,311 +0,0 @@
# Doxyfile 1.5.5-KDevelop
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = clienttest
PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = /home/brukie/
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = /home/brukie/clienttest
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py \
*.f90 \
*.f \
*.vhd \
*.vhdl \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.PY \
*.F90 \
*.F \
*.VHD \
*.VHDL \
*.C \
*.H \
*.tlh \
*.diff \
*.patch \
*.moc \
*.xpm \
*.dox
RECURSIVE = yes
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NONE
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = yes
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE = clienttest.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO

View file

@ -0,0 +1,158 @@
INCLUDE(FindQt4)
set(MOBILITY_CONFIG_MKSPECS_FILE "")
IF(EXISTS "${QT_MKSPECS_DIR}/features/mobilityconfig.prf")
set(MOBILITY_CONFIG_MKSPECS_FILE "${QT_MKSPECS_DIR}/features/mobilityconfig.prf")
ELSEIF(EXISTS "${QT_MKSPECS_DIR}/features/mobility.prf")
set(MOBILITY_CONFIG_MKSPECS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/mobilityconfig.prf")
ENDIF()
macro(export_component component)
IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "")
FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_FILE_CONTENTS)
STRING(TOLOWER ${component} _COMPONENT)
IF(${MOBILITY_FILE_CONTENTS} MATCHES "MOBILITY_CONFIG=.*${_COMPONENT}.*")
STRING(TOUPPER ${component} _COMPONENT)
SET(QT_MOBILITY_${_COMPONENT}_FOUND 1)
SET(QT_MOBILITY_${_COMPONENT}_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/Qt${component})
SET(QT_MOBILITY_${_COMPONENT}_LIBRARY Qt${component})
ENDIF()
ENDIF()
endmacro()
set(VERSION_INFO "")
set(FEATURE_FILE_PREFIX "${QT_MKSPECS_DIR}/features/mobility")
if(DEFINED MOBILITY_VERSION)
if(MOBILITY_VERSION STREQUAL "1.1" AND EXISTS "${FEATURE_FILE_PREFIX}11.prf")
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}11.prf")
set(VERSION_INFO "1.1")
elseif(MOBILITY_VERSION STREQUAL "1.2" AND EXISTS "${FEATURE_FILE_PREFIX}12.prf")
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}12.prf")
set(VERSION_INFO "1.2")
elseif(MOBILITY_VERSION STREQUAL "default" AND EXISTS "${FEATURE_FILE_PREFIX}.prf")
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}.prf")
set(VERSION_INFO "system's default")
else()
message(STATUS "Couldn't find QtMobility version: ${MOBILITY_VERSION}")
endif()
endif()
if(NOT DEFINED MOBILITY_PRF_FILE)
if(EXISTS "${FEATURE_FILE_PREFIX}.prf")
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}.prf")
set(VERSION_INFO "system's default")
elseif(EXISTS "${FEATURE_FILE_PREFIX}12.prf")
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}12.prf")
set(VERSION_INFO "1.2")
elseif(EXISTS "${FEATURE_FILE_PREFIX}11.prf")
set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}11.prf")
set(VERSION_INFO "1.1")
else()
message(FATAL_ERROR "Couldn't find any version of QtMobility.")
endif()
endif()
message(STATUS "Using QtMobility version: ${VERSION_INFO}")
IF(DEFINED MOBILITY_PRF_FILE)
FILE(READ ${MOBILITY_PRF_FILE} MOBILITY_FILE_CONTENTS)
STRING(REGEX MATCH "MOBILITY_PREFIX=([^\n]+)" QT_MOBILITY_PREFIX "${MOBILITY_FILE_CONTENTS}")
SET(QT_MOBILITY_PREFIX ${CMAKE_MATCH_1})
STRING(REGEX MATCH "MOBILITY_INCLUDE=([^\n]+)" QT_MOBILITY_INCLUDE_DIR "${MOBILITY_FILE_CONTENTS}")
SET(QT_MOBILITY_INCLUDE_DIR ${CMAKE_MATCH_1})
STRING(REGEX MATCH "MOBILITY_LIB=([^\n]+)" "\\1" QT_MOBILITY_LIBRARY "${MOBILITY_FILE_CONTENTS}")
SET(QT_MOBILITY_LIBRARY_DIR ${CMAKE_MATCH_1})
#VERSION
IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "")
FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_CONFIG_FILE_CONTENTS)
STRING(REGEX MATCH "MOBILITY_VERSION = ([^\n]+)" QT_MOBILITY_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
SET(QT_MOBILITY_VERSION ${CMAKE_MATCH_1})
STRING(REGEX MATCH "MOBILITY_MAJOR_VERSION = ([^\n]+)" QT_MOBILITY_MAJOR_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
SET(QT_MOBILITY_MAJOR_VERSION ${CMAKE_MATCH_1})
STRING(REGEX MATCH "MOBILITY_MINOR_VERSION = ([^\n]+)" QT_MOBILITY_MINOR_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
SET(QT_MOBILITY_MINOR_VERSION ${CMAKE_MATCH_1})
STRING(REGEX MATCH "MOBILITY_PATCH_VERSION = ([^\n]+)" QT_MOBILITY_PATCH_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}")
SET(QT_MOBILITY_PATCH_VERSION ${CMAKE_MATCH_1})
ELSE()
SET(QT_MOBILITY_VERSION 1.0.0)
SET(QT_MOBILITY_MAJOR_VERSION 1)
SET(QT_MOBILITY_MINOR_VERSION 0)
SET(QT_MOBILITY_PATCH_VERSION 0)
ENDIF()
SET(QT_MOBILITY_PARENT_INCLUDE_DIR ${QT_MOBILITY_INCLUDE_DIR})
SET(QT_MOBILITY_INCLUDE_DIR ${QT_MOBILITY_INCLUDE_DIR}/QtMobility)
IF(QtMobility_FIND_VERSION_EXACT)
IF(QT_MOBILITY_VERSION VERSION_EQUAL QtMobility_FIND_VERSION)
SET(QT_MOBILITY_FOUND TRUE)
ELSE()
SET(QT_MOBILITY_FOUND FALSE)
IF(QT_MOBILITY_VERSION VERSION_LESS QtMobility_FIND_VERSION)
SET(QT_MOBILITY_TOO_OLD TRUE)
ELSE()
SET(QT_MOBILITY_TOO_NEW TRUE)
ENDIF()
ENDIF()
ELSE()
IF(QT_MOBILITY_VERSION VERSION_LESS QtMobility_FIND_VERSION)
SET(QT_MOBILITY_FOUND FALSE)
SET(QT_MOBILITY_TOO_OLD TRUE)
ELSE()
SET(QT_MOBILITY_FOUND TRUE)
ENDIF()
ENDIF()
ELSE()
SET(QT_MOBILITY_FOUND NOTFOUND)
SET(QT_MOBILITY_PREFIX NOTFOUND)
SET(QT_MOBILITY_INCLUDE NOTFOUND)
SET(QT_MOBILITY_LIB NOTFOUND)
ENDIF()
IF(NOT QT_MOBILITY_FOUND)
if(QT_MOBILITY_TOO_OLD)
MESSAGE(FATAL_ERROR "The installed QtMobility version ${QT_MOBILITY_VERSION} it too old, version ${QtMobility_FIND_VERSION} is required.")
ELSEIF(QT_MOBILITY_TOO_NEW)
MESSAGE(FATAL_ERROR "The installed QtMobility version ${QT_MOBILITY_VERSION} it too new, version ${QtMobility_FIND_VERSION} is required.")
ELSE()
MESSAGE(FATAL_ERROR "QtMobility not found.")
ENDIF()
ELSE()
export_component(Bearer)
export_component(Feedback)
export_component(Gallery)
export_component(PublishSubscribe)
export_component(Location)
export_component(Organizer)
export_component(ServiceFramework)
export_component(SystemInfo)
export_component(Contacts)
export_component(Messaging)
export_component(Versit)
export_component(Sensors)
# VersitOrganizer
if(${QT_MOBILITY_CONTACTS_FOUND} AND ${QT_MOBILITY_VERSIT_FOUND})
SET(QT_MOBILITY_VERSITORGANIZER_FOUND 1)
SET(QT_MOBILITY_VERSITORGANIZER_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/QtVersitOrganizer)
SET(QT_MOBILITY_VERSITORGANIZER_LIBRARY QtVersitOrganizer)
endif()
# MultimediaKit - it's just 'multimedia' in the .prf file.
IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "")
FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_FILE_CONTENTS)
IF(${MOBILITY_FILE_CONTENTS} MATCHES "MOBILITY_CONFIG=.*multimedia.*")
SET(QT_MOBILITY_MULTIMEDIAKIT_FOUND 1)
SET(QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/QtMultimediaKit)
SET(QT_MOBILITY_MULTIMEDIAKIT_LIBRARY QtMultimediaKit)
ENDIF()
ENDIF()
ENDIF()

View file

@ -1,210 +0,0 @@
TEMPLATE = app
TARGET = cockatrice
DEPENDPATH += . src ../common
INCLUDEPATH += . src ../common
MOC_DIR = build
OBJECTS_DIR = build
RESOURCES = cockatrice.qrc
QMAKE_CXXFLAGS_RELEASE += -O2
CPPFLAGS += -O2
QT += network script svg
LIBS += -lprotobuf
unix:!macx {
CONFIG += mobility
MOBILITY = multimedia
} else {
QT += multimedia
}
HEADERS += src/abstractcounter.h \
src/counter_general.h \
src/dlg_creategame.h \
src/dlg_connect.h \
src/dlg_create_token.h \
src/gamesmodel.h \
src/abstractclient.h \
src/remoteclient.h \
src/window_main.h \
src/cardzone.h \
src/selectzone.h \
src/player.h \
src/playertarget.h \
src/cardlist.h \
src/abstractcarditem.h \
src/carditem.h \
src/tablezone.h \
src/handzone.h \
src/handcounter.h \
src/carddatabase.h \
src/gameview.h \
src/gameselector.h \
src/gametypemap.h \
src/decklistmodel.h \
src/dlg_load_deck_from_clipboard.h \
src/dlg_load_remote_deck.h \
src/cardinfowidget.h \
src/messagelogwidget.h \
src/zoneviewzone.h \
src/zoneviewwidget.h \
src/pilezone.h \
src/stackzone.h \
src/carddragitem.h \
src/carddatabasemodel.h \
src/window_deckeditor.h \
src/setsmodel.h \
src/window_sets.h \
src/abstractgraphicsitem.h \
src/abstractcarddragitem.h \
src/dlg_settings.h \
src/dlg_cardsearch.h \
src/phasestoolbar.h \
src/gamescene.h \
src/arrowitem.h \
src/arrowtarget.h \
src/tab.h \
src/tab_server.h \
src/tab_room.h \
src/tab_message.h \
src/tab_game.h \
src/tab_deck_storage.h \
src/tab_supervisor.h \
src/tab_admin.h \
src/tab_userlists.h \
src/chatview.h \
src/userlist.h \
src/userinfobox.h \
src/remotedecklist_treewidget.h \
src/deckview.h \
src/playerlistwidget.h \
src/pixmapgenerator.h \
src/settingscache.h \
src/localserver.h \
src/localserverinterface.h \
src/localclient.h \
src/translation.h \
src/priceupdater.h \
src/soundengine.h \
src/pending_command.h \
../common/get_pb_extension.h \
../common/color.h \
../common/decklist.h \
../common/rng_abstract.h \
../common/rng_sfmt.h \
../common/server.h \
../common/server_response_containers.h \
../common/server_arrow.h \
../common/server_card.h \
../common/server_cardzone.h \
../common/server_room.h \
../common/server_counter.h \
../common/server_game.h \
../common/server_player.h \
../common/server_protocolhandler.h \
../common/server_arrowtarget.h
SOURCES += src/abstractcounter.cpp \
src/counter_general.cpp \
src/dlg_creategame.cpp \
src/dlg_connect.cpp \
src/dlg_create_token.cpp \
src/abstractclient.cpp \
src/remoteclient.cpp \
src/main.cpp \
src/window_main.cpp \
src/gamesmodel.cpp \
src/player.cpp \
src/playertarget.cpp \
src/cardzone.cpp \
src/selectzone.cpp \
src/cardlist.cpp \
src/abstractcarditem.cpp \
src/carditem.cpp \
src/tablezone.cpp \
src/handzone.cpp \
src/handcounter.cpp \
src/carddatabase.cpp \
src/gameview.cpp \
src/gameselector.cpp \
src/decklistmodel.cpp \
src/dlg_load_deck_from_clipboard.cpp \
src/dlg_load_remote_deck.cpp \
src/cardinfowidget.cpp \
src/messagelogwidget.cpp \
src/zoneviewzone.cpp \
src/zoneviewwidget.cpp \
src/pilezone.cpp \
src/stackzone.cpp \
src/carddragitem.cpp \
src/carddatabasemodel.cpp \
src/window_deckeditor.cpp \
src/setsmodel.cpp \
src/window_sets.cpp \
src/abstractgraphicsitem.cpp \
src/abstractcarddragitem.cpp \
src/dlg_settings.cpp \
src/dlg_cardsearch.cpp \
src/phasestoolbar.cpp \
src/gamescene.cpp \
src/arrowitem.cpp \
src/arrowtarget.cpp \
src/tab.cpp \
src/tab_server.cpp \
src/tab_room.cpp \
src/tab_message.cpp \
src/tab_game.cpp \
src/tab_deck_storage.cpp \
src/tab_supervisor.cpp \
src/tab_admin.cpp \
src/tab_userlists.cpp \
src/chatview.cpp \
src/userlist.cpp \
src/userinfobox.cpp \
src/remotedecklist_treewidget.cpp \
src/deckview.cpp \
src/playerlistwidget.cpp \
src/pixmapgenerator.cpp \
src/settingscache.cpp \
src/localserver.cpp \
src/localserverinterface.cpp \
src/localclient.cpp \
src/priceupdater.cpp \
src/soundengine.cpp \
../common/get_pb_extension.cpp \
../common/decklist.cpp \
../common/rng_abstract.cpp \
../common/rng_sfmt.cpp \
../common/sfmt/SFMT.c \
../common/server.cpp \
../common/server_response_containers.cpp \
../common/server_card.cpp \
../common/server_cardzone.cpp \
../common/server_room.cpp \
../common/server_game.cpp \
../common/server_player.cpp \
../common/server_protocolhandler.cpp
include ( ../pb_headers )
include ( ../pb_sources )
TRANSLATIONS += \
translations/cockatrice_de.ts \
translations/cockatrice_en.ts \
translations/cockatrice_es.ts \
translations/cockatrice_pt.ts \
translations/cockatrice_pt-br.ts \
translations/cockatrice_fr.ts \
translations/cockatrice_it.ts \
translations/cockatrice_ja.ts \
translations/cockatrice_ru.ts \
translations/cockatrice_cs.ts \
translations/cockatrice_pl.ts \
translations/cockatrice_sk.ts
win32 {
RC_FILE = cockatrice.rc
}
macx {
ICON = resources/appicon.icns
CONFIG += x86 ppc x86_64 release
LIBS += -bind_at_load
}

View file

@ -8,6 +8,7 @@ class Player;
class ArrowItem; class ArrowItem;
class ArrowTarget : public AbstractGraphicsItem { class ArrowTarget : public AbstractGraphicsItem {
Q_OBJECT
protected: protected:
Player *owner; Player *owner;
private: private:

View file

@ -6,6 +6,7 @@
class CardItem; class CardItem;
class CardDragItem : public AbstractCardDragItem { class CardDragItem : public AbstractCardDragItem {
Q_OBJECT
private: private:
int id; int id;
bool faceDown; bool faceDown;

View file

@ -4,6 +4,7 @@
#include "cardzone.h" #include "cardzone.h"
class PileZone : public CardZone { class PileZone : public CardZone {
Q_OBJECT
public: public:
PileZone(Player *_p, const QString &_name, bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent = 0); PileZone(Player *_p, const QString &_name, bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent = 0);
QRectF boundingRect() const; QRectF boundingRect() const;

45
common/CMakeLists.txt Normal file
View file

@ -0,0 +1,45 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(common_SOURCES
decklist.cpp
get_pb_extension.cpp
rng_abstract.cpp
rng_qt.cpp
rng_sfmt.cpp
server.cpp
server_card.cpp
server_cardzone.cpp
server_game.cpp
server_player.cpp
server_protocolhandler.cpp
server_response_containers.cpp
server_room.cpp
sfmt/SFMT.c
)
SET(common_HEADERS
decklist.h
rng_abstract.h
rng_qt.h
rng_sfmt.h
server.h
server_arrowtarget.h
server_card.h
server_game.h
server_player.h
server_protocolhandler.h
server_room.h
)
FIND_PACKAGE(Qt4 REQUIRED)
set(CMAKE_BUILD_TYPE Release)
QT4_WRAP_CPP(common_HEADERS_MOC ${common_HEADERS})
INCLUDE(${QT_USE_FILE})
INCLUDE_DIRECTORIES(pb)
INCLUDE_DIRECTORIES(sfmt)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(pb)
add_library(cockatrice_common ${common_SOURCES} ${common_HEADERS_MOC})
target_link_libraries(cockatrice_common cockatrice_protocol)

138
common/pb/CMakeLists.txt Normal file
View file

@ -0,0 +1,138 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROTO_FILES
admin_commands.proto
card_attributes.proto
color.proto
command_attach_card.proto
command_concede.proto
command_create_arrow.proto
command_create_counter.proto
command_create_token.proto
command_deck_del_dir.proto
command_deck_del.proto
command_deck_download.proto
command_deck_new_dir.proto
command_deck_select.proto
command_deck_upload.proto
command_del_counter.proto
command_delete_arrow.proto
command_draw_cards.proto
command_dump_zone.proto
command_flip_card.proto
command_game_say.proto
command_inc_card_counter.proto
command_inc_counter.proto
command_kick_from_game.proto
command_leave_game.proto
command_move_card.proto
command_mulligan.proto
command_next_turn.proto
command_ready_start.proto
command_reveal_cards.proto
command_roll_die.proto
command_set_active_phase.proto
command_set_card_attr.proto
command_set_card_counter.proto
command_set_counter.proto
command_set_sideboard_plan.proto
command_shuffle.proto
commands.proto
command_stop_dump_zone.proto
command_undo_draw.proto
context_concede.proto
context_deck_select.proto
context_move_card.proto
context_mulligan.proto
context_ready_start.proto
context_undo_draw.proto
event_add_to_list.proto
event_attach_card.proto
event_connection_closed.proto
event_connection_state_changed.proto
event_create_arrow.proto
event_create_counter.proto
event_create_token.proto
event_del_counter.proto
event_delete_arrow.proto
event_destroy_card.proto
event_draw_cards.proto
event_dump_zone.proto
event_flip_card.proto
event_game_closed.proto
event_game_host_changed.proto
event_game_joined.proto
event_game_say.proto
event_game_state_changed.proto
event_join.proto
event_join_room.proto
event_kicked.proto
event_leave.proto
event_leave_room.proto
event_list_games.proto
event_list_rooms.proto
event_move_card.proto
event_ping.proto
event_player_properties_changed.proto
event_remove_from_list.proto
event_reveal_cards.proto
event_roll_die.proto
event_room_say.proto
event_server_identification.proto
event_server_message.proto
event_server_shutdown.proto
event_set_active_phase.proto
event_set_active_player.proto
event_set_card_attr.proto
event_set_card_counter.proto
event_set_counter.proto
event_shuffle.proto
event_stop_dump_zone.proto
event_user_joined.proto
event_user_left.proto
event_user_message.proto
game_commands.proto
game_event_container.proto
game_event_context.proto
game_event.proto
moderator_commands.proto
move_card_to_zone.proto
response_deck_download.proto
response_deck_list.proto
response_deck_upload.proto
response_dump_zone.proto
response_get_games_of_user.proto
response_get_user_info.proto
response_join_room.proto
response_list_users.proto
response_login.proto
response.proto
room_commands.proto
room_event.proto
serverinfo_arrow.proto
serverinfo_cardcounter.proto
serverinfo_card.proto
serverinfo_counter.proto
serverinfo_deckstorage.proto
serverinfo_game.proto
serverinfo_gametype.proto
serverinfo_playerping.proto
serverinfo_playerproperties.proto
serverinfo_player.proto
serverinfo_room.proto
serverinfo_user.proto
serverinfo_zone.proto
server_message.proto
session_commands.proto
session_event.proto
)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
set(CMAKE_BUILD_TYPE Release)
add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS})
#target_link_libraries(${PROTOBUF_LIBRARIES})

Some files were not shown because too many files have changed in this diff Show more