Re-indent CMakeLists.txt using spaces

This commit is contained in:
Fabio Bas 2014-06-11 18:08:30 +02:00
parent ed0311d59e
commit 721cf6fe4f
6 changed files with 436 additions and 407 deletions

View file

@ -12,24 +12,24 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
# Define a proper install path # Define a proper install path
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
# MacOS X # MacOS X
# Due to the special bundle structure ignore # Due to the special bundle structure ignore
# the prefix eventually set by the user. # the prefix eventually set by the user.
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
else() else()
# Linux / BSD # Linux / BSD
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#fix package build #fix package build
if(PREFIX) if(PREFIX)
set(CMAKE_INSTALL_PREFIX ${PREFIX}) set(CMAKE_INSTALL_PREFIX ${PREFIX})
else() else()
set(CMAKE_INSTALL_PREFIX /usr/local) set(CMAKE_INSTALL_PREFIX /usr/local)
endif() endif()
endif() endif()
endif() endif()
elseif(WIN32) elseif(WIN32)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/release)
endif() endif()
# Force "Release" build type by default # Force "Release" build type by default
@ -37,18 +37,18 @@ set(CMAKE_BUILD_TYPE Release)
# Define proper compilation flags # Define proper compilation flags
IF (CMAKE_COMPILER_IS_GNUCC) IF (CMAKE_COMPILER_IS_GNUCC)
# linux/gcc, bsd/gcc, windows/mingw # linux/gcc, bsd/gcc, windows/mingw
set(CMAKE_CXX_FLAGS_RELEASE "-s -O2") set(CMAKE_CXX_FLAGS_RELEASE "-s -O2")
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0") set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0")
else() else()
# other: osx/llvm, bsd/llvm # other: osx/llvm, bsd/llvm
set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
ENDIF (CMAKE_COMPILER_IS_GNUCC) ENDIF (CMAKE_COMPILER_IS_GNUCC)
# GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning # GNU systems need to define the Mersenne exponent for the RNG to compile w/o warning
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
ADD_DEFINITIONS("-DSFMT_MEXP=19937") ADD_DEFINITIONS("-DSFMT_MEXP=19937")
ENDIF() ENDIF()
#Find Qt4 and enable the needed features #Find Qt4 and enable the needed features
@ -62,18 +62,18 @@ FIND_PACKAGE(Protobuf REQUIRED)
# Compile servatrice (default off) # Compile servatrice (default off)
add_subdirectory(common) add_subdirectory(common)
if(WITH_SERVER) if(WITH_SERVER)
add_subdirectory(servatrice) add_subdirectory(servatrice)
endif(WITH_SERVER) endif(WITH_SERVER)
# Compile cockatrice+oracle (default on) # Compile cockatrice+oracle (default on)
if (NOT WITHOUT_CLIENT) if (NOT WITHOUT_CLIENT)
add_subdirectory(cockatrice) add_subdirectory(cockatrice)
add_subdirectory(oracle) add_subdirectory(oracle)
add_subdirectory(sounds) add_subdirectory(sounds)
add_subdirectory(zonebg) add_subdirectory(zonebg)
endif(NOT WITHOUT_CLIENT) endif(NOT WITHOUT_CLIENT)
# Compile testclient (default off) # Compile testclient (default off)
if (WITH_TESTCLIENT) if (WITH_TESTCLIENT)
add_subdirectory(testclient) add_subdirectory(testclient)
endif(WITH_TESTCLIENT) endif(WITH_TESTCLIENT)

View file

@ -5,128 +5,128 @@
PROJECT(cockatrice) PROJECT(cockatrice)
SET(cockatrice_SOURCES SET(cockatrice_SOURCES
src/abstractcounter.cpp src/abstractcounter.cpp
src/counter_general.cpp src/counter_general.cpp
src/dlg_creategame.cpp src/dlg_creategame.cpp
src/dlg_filter_games.cpp src/dlg_filter_games.cpp
src/dlg_connect.cpp src/dlg_connect.cpp
src/dlg_create_token.cpp src/dlg_create_token.cpp
src/dlg_edit_tokens.cpp src/dlg_edit_tokens.cpp
src/abstractclient.cpp src/abstractclient.cpp
src/remoteclient.cpp src/remoteclient.cpp
src/main.cpp src/main.cpp
src/window_main.cpp src/window_main.cpp
src/gamesmodel.cpp src/gamesmodel.cpp
src/player.cpp src/player.cpp
src/playertarget.cpp src/playertarget.cpp
src/cardzone.cpp src/cardzone.cpp
src/selectzone.cpp src/selectzone.cpp
src/cardlist.cpp src/cardlist.cpp
src/abstractcarditem.cpp src/abstractcarditem.cpp
src/carditem.cpp src/carditem.cpp
src/tablezone.cpp src/tablezone.cpp
src/handzone.cpp src/handzone.cpp
src/handcounter.cpp src/handcounter.cpp
src/carddatabase.cpp src/carddatabase.cpp
src/keysignals.cpp src/keysignals.cpp
src/gameview.cpp src/gameview.cpp
src/gameselector.cpp src/gameselector.cpp
src/decklistmodel.cpp src/decklistmodel.cpp
src/deck_loader.cpp src/deck_loader.cpp
src/dlg_load_deck_from_clipboard.cpp src/dlg_load_deck_from_clipboard.cpp
src/dlg_load_remote_deck.cpp src/dlg_load_remote_deck.cpp
src/cardinfowidget.cpp src/cardinfowidget.cpp
src/cardframe.cpp src/cardframe.cpp
src/cardinfopicture.cpp src/cardinfopicture.cpp
src/cardinfotext.cpp src/cardinfotext.cpp
src/filterbuilder.cpp src/filterbuilder.cpp
src/cardfilter.cpp src/cardfilter.cpp
src/filtertreemodel.cpp src/filtertreemodel.cpp
src/filtertree.cpp src/filtertree.cpp
src/messagelogwidget.cpp src/messagelogwidget.cpp
src/zoneviewzone.cpp src/zoneviewzone.cpp
src/zoneviewwidget.cpp src/zoneviewwidget.cpp
src/pilezone.cpp src/pilezone.cpp
src/stackzone.cpp src/stackzone.cpp
src/carddragitem.cpp src/carddragitem.cpp
src/carddatabasemodel.cpp src/carddatabasemodel.cpp
src/setsmodel.cpp src/setsmodel.cpp
src/window_sets.cpp src/window_sets.cpp
src/abstractgraphicsitem.cpp src/abstractgraphicsitem.cpp
src/abstractcarddragitem.cpp src/abstractcarddragitem.cpp
src/dlg_settings.cpp src/dlg_settings.cpp
src/dlg_cardsearch.cpp src/dlg_cardsearch.cpp
src/phasestoolbar.cpp src/phasestoolbar.cpp
src/gamescene.cpp src/gamescene.cpp
src/arrowitem.cpp src/arrowitem.cpp
src/arrowtarget.cpp src/arrowtarget.cpp
src/tab.cpp src/tab.cpp
src/tab_server.cpp src/tab_server.cpp
src/tab_room.cpp src/tab_room.cpp
src/tab_message.cpp src/tab_message.cpp
src/tab_game.cpp src/tab_game.cpp
src/tab_deck_storage.cpp src/tab_deck_storage.cpp
src/tab_replays.cpp src/tab_replays.cpp
src/tab_supervisor.cpp src/tab_supervisor.cpp
src/tab_admin.cpp src/tab_admin.cpp
src/tab_userlists.cpp src/tab_userlists.cpp
src/tab_deck_editor.cpp src/tab_deck_editor.cpp
src/replay_timeline_widget.cpp src/replay_timeline_widget.cpp
src/deckstats_interface.cpp src/deckstats_interface.cpp
src/chatview.cpp src/chatview.cpp
src/userlist.cpp src/userlist.cpp
src/userinfobox.cpp src/userinfobox.cpp
src/user_context_menu.cpp src/user_context_menu.cpp
src/remotedecklist_treewidget.cpp src/remotedecklist_treewidget.cpp
src/remotereplaylist_treewidget.cpp src/remotereplaylist_treewidget.cpp
src/deckview.cpp src/deckview.cpp
src/playerlistwidget.cpp src/playerlistwidget.cpp
src/pixmapgenerator.cpp src/pixmapgenerator.cpp
src/settingscache.cpp src/settingscache.cpp
src/localserver.cpp src/localserver.cpp
src/localserverinterface.cpp src/localserverinterface.cpp
src/localclient.cpp src/localclient.cpp
src/priceupdater.cpp src/priceupdater.cpp
src/qt-json/json.cpp src/qt-json/json.cpp
src/soundengine.cpp src/soundengine.cpp
src/pending_command.cpp src/pending_command.cpp
${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp ${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp
) )
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
set_source_files_properties(src/main.cpp PROPERTIES COMPILE_FLAGS -DTRANSLATION_PATH=\\"${CMAKE_INSTALL_PREFIX}/share/cockatrice/translations\\") set_source_files_properties(src/main.cpp PROPERTIES COMPILE_FLAGS -DTRANSLATION_PATH=\\"${CMAKE_INSTALL_PREFIX}/share/cockatrice/translations\\")
endif (UNIX AND NOT APPLE) endif (UNIX AND NOT APPLE)
set(cockatrice_RESOURCES cockatrice.qrc) set(cockatrice_RESOURCES cockatrice.qrc)
set(cockatrice_TS set(cockatrice_TS
# translations/cockatrice_cs.ts # translations/cockatrice_cs.ts
translations/cockatrice_de.ts translations/cockatrice_de.ts
translations/cockatrice_en.ts translations/cockatrice_en.ts
translations/cockatrice_es.ts translations/cockatrice_es.ts
# translations/cockatrice_fr.ts # translations/cockatrice_fr.ts
translations/cockatrice_it.ts translations/cockatrice_it.ts
translations/cockatrice_ja.ts translations/cockatrice_ja.ts
# translations/cockatrice_pl.ts # translations/cockatrice_pl.ts
# translations/cockatrice_pt-br.ts # translations/cockatrice_pt-br.ts
translations/cockatrice_pt.ts translations/cockatrice_pt.ts
# translations/cockatrice_ru.ts # translations/cockatrice_ru.ts
# translations/cockatrice_sk.ts # translations/cockatrice_sk.ts
translations/cockatrice_sv.ts translations/cockatrice_sv.ts
# translations/cockatrice_zh_CN.ts # translations/cockatrice_zh_CN.ts
) )
if(WIN32) if(WIN32)
set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc) set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc)
endif(WIN32) endif(WIN32)
if(APPLE) if(APPLE)
set(MACOSX_BUNDLE_ICON_FILE appicon.icns) set(MACOSX_BUNDLE_ICON_FILE appicon.icns)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(cockatrice_SOURCES ${cockatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns) set(cockatrice_SOURCES ${cockatrice_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/resources/appicon.icns)
ENDIF(APPLE) ENDIF(APPLE)
if (NOT QT_QTMULTIMEDIA_FOUND) if (NOT QT_QTMULTIMEDIA_FOUND)
FIND_PACKAGE(QtMobility REQUIRED) FIND_PACKAGE(QtMobility REQUIRED)
endif (NOT QT_QTMULTIMEDIA_FOUND) endif (NOT QT_QTMULTIMEDIA_FOUND)
SET(QT_USE_QTNETWORK TRUE) SET(QT_USE_QTNETWORK TRUE)
@ -158,53 +158,53 @@ TARGET_LINK_LIBRARIES(cockatrice cockatrice_common ${QT_LIBRARIES} ${QT_MOBILITY
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
INSTALL(TARGETS cockatrice BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS cockatrice BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
else() else()
# Assume linux # Assume linux
INSTALL(TARGETS cockatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL(TARGETS cockatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif() endif()
elseif(WIN32) elseif(WIN32)
INSTALL(TARGETS cockatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS cockatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
endif() endif()
if (NOT WIN32 AND NOT APPLE) if (NOT WIN32 AND NOT APPLE)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.png DESTINATION ${ICONDIR}/hicolor/48x48/apps)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/cockatrice.svg DESTINATION ${ICONDIR}/hicolor/scalable/apps)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cockatrice.desktop DESTINATION ${DESKTOPDIR}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cockatrice.desktop DESTINATION ${DESKTOPDIR})
INSTALL(FILES ${cockatrice_QM} DESTINATION share/cockatrice/translations) INSTALL(FILES ${cockatrice_QM} DESTINATION share/cockatrice/translations)
ENDIF(NOT WIN32 AND NOT APPLE) ENDIF(NOT WIN32 AND NOT APPLE)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp ${CMAKE_CURRENT_BINARY_DIR}/version_string.h OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp ${CMAKE_CURRENT_BINARY_DIR}/version_string.h
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/../common/getversion.cmake COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/../common/getversion.cmake
) )
if(APPLE) if(APPLE)
set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Plugins) set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Plugins)
set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Resources) set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/cockatrice.app/Contents/Resources)
# note: no codecs in qt5 # note: no codecs in qt5
# note: phonon_backend => mediaservice # note: phonon_backend => mediaservice
# note: needs platform on osx # note: needs platform on osx
if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (CMAKE_BUILD_TYPE STREQUAL "Debug")
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib") FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib")
else() else()
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib") FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib")
endif() endif()
install(CODE " install(CODE "
file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths] file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths]
Plugins = Plugins\") Plugins = Plugins\")
" COMPONENT Runtime) " COMPONENT Runtime)
install(CODE " install(CODE "
file(GLOB_RECURSE QTPLUGINS file(GLOB_RECURSE QTPLUGINS
\"${plugin_dest_dir}/*.dylib\") \"${plugin_dest_dir}/*.dylib\")
include(BundleUtilities) include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/cockatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/cockatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
" COMPONENT Runtime) " COMPONENT Runtime)
endif() endif()

View file

@ -6,26 +6,26 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
add_subdirectory(pb) add_subdirectory(pb)
SET(common_SOURCES SET(common_SOURCES
decklist.cpp decklist.cpp
get_pb_extension.cpp get_pb_extension.cpp
rng_abstract.cpp rng_abstract.cpp
rng_sfmt.cpp rng_sfmt.cpp
server.cpp server.cpp
server_abstractuserinterface.cpp server_abstractuserinterface.cpp
server_arrow.cpp server_arrow.cpp
server_arrowtarget.h server_arrowtarget.h
server_card.cpp server_card.cpp
server_cardzone.cpp server_cardzone.cpp
server_counter.cpp server_counter.cpp
server_game.cpp server_game.cpp
server_database_interface.cpp server_database_interface.cpp
server_player.cpp server_player.cpp
server_protocolhandler.cpp server_protocolhandler.cpp
server_remoteuserinterface.cpp server_remoteuserinterface.cpp
server_response_containers.cpp server_response_containers.cpp
server_room.cpp server_room.cpp
serverinfo_user_container.cpp serverinfo_user_container.cpp
sfmt/SFMT.c sfmt/SFMT.c
) )
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})

View file

@ -5,147 +5,147 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(PROTO_FILES SET(PROTO_FILES
admin_commands.proto admin_commands.proto
card_attributes.proto card_attributes.proto
color.proto color.proto
command_attach_card.proto command_attach_card.proto
command_change_zone_properties.proto command_change_zone_properties.proto
command_concede.proto command_concede.proto
command_create_arrow.proto command_create_arrow.proto
command_create_counter.proto command_create_counter.proto
command_create_token.proto command_create_token.proto
command_deck_del_dir.proto command_deck_del_dir.proto
command_deck_del.proto command_deck_del.proto
command_deck_download.proto command_deck_download.proto
command_deck_list.proto command_deck_list.proto
command_deck_new_dir.proto command_deck_new_dir.proto
command_deck_select.proto command_deck_select.proto
command_deck_upload.proto command_deck_upload.proto
command_del_counter.proto command_del_counter.proto
command_delete_arrow.proto command_delete_arrow.proto
command_draw_cards.proto command_draw_cards.proto
command_dump_zone.proto command_dump_zone.proto
command_flip_card.proto command_flip_card.proto
command_game_say.proto command_game_say.proto
command_inc_card_counter.proto command_inc_card_counter.proto
command_inc_counter.proto command_inc_counter.proto
command_kick_from_game.proto command_kick_from_game.proto
command_leave_game.proto command_leave_game.proto
command_move_card.proto command_move_card.proto
command_mulligan.proto command_mulligan.proto
command_next_turn.proto command_next_turn.proto
command_ready_start.proto command_ready_start.proto
command_replay_delete_match.proto command_replay_delete_match.proto
command_replay_list.proto command_replay_list.proto
command_replay_download.proto command_replay_download.proto
command_replay_modify_match.proto command_replay_modify_match.proto
command_reveal_cards.proto command_reveal_cards.proto
command_roll_die.proto command_roll_die.proto
command_set_active_phase.proto command_set_active_phase.proto
command_set_card_attr.proto command_set_card_attr.proto
command_set_card_counter.proto command_set_card_counter.proto
command_set_counter.proto command_set_counter.proto
command_set_sideboard_plan.proto command_set_sideboard_plan.proto
command_set_sideboard_lock.proto command_set_sideboard_lock.proto
command_shuffle.proto command_shuffle.proto
commands.proto commands.proto
command_stop_dump_zone.proto command_stop_dump_zone.proto
command_undo_draw.proto command_undo_draw.proto
context_concede.proto context_concede.proto
context_connection_state_changed.proto context_connection_state_changed.proto
context_deck_select.proto context_deck_select.proto
context_move_card.proto context_move_card.proto
context_mulligan.proto context_mulligan.proto
context_ping_changed.proto context_ping_changed.proto
context_ready_start.proto context_ready_start.proto
context_set_sideboard_lock.proto context_set_sideboard_lock.proto
context_undo_draw.proto context_undo_draw.proto
event_add_to_list.proto event_add_to_list.proto
event_attach_card.proto event_attach_card.proto
event_change_zone_properties.proto event_change_zone_properties.proto
event_connection_closed.proto event_connection_closed.proto
event_create_arrow.proto event_create_arrow.proto
event_create_counter.proto event_create_counter.proto
event_create_token.proto event_create_token.proto
event_del_counter.proto event_del_counter.proto
event_delete_arrow.proto event_delete_arrow.proto
event_destroy_card.proto event_destroy_card.proto
event_draw_cards.proto event_draw_cards.proto
event_dump_zone.proto event_dump_zone.proto
event_flip_card.proto event_flip_card.proto
event_game_closed.proto event_game_closed.proto
event_game_host_changed.proto event_game_host_changed.proto
event_game_joined.proto event_game_joined.proto
event_game_say.proto event_game_say.proto
event_game_state_changed.proto event_game_state_changed.proto
event_join.proto event_join.proto
event_join_room.proto event_join_room.proto
event_kicked.proto event_kicked.proto
event_leave.proto event_leave.proto
event_leave_room.proto event_leave_room.proto
event_list_games.proto event_list_games.proto
event_list_rooms.proto event_list_rooms.proto
event_move_card.proto event_move_card.proto
event_player_properties_changed.proto event_player_properties_changed.proto
event_remove_from_list.proto event_remove_from_list.proto
event_replay_added.proto event_replay_added.proto
event_reveal_cards.proto event_reveal_cards.proto
event_roll_die.proto event_roll_die.proto
event_room_say.proto event_room_say.proto
event_server_complete_list.proto event_server_complete_list.proto
event_server_identification.proto event_server_identification.proto
event_server_message.proto event_server_message.proto
event_server_shutdown.proto event_server_shutdown.proto
event_set_active_phase.proto event_set_active_phase.proto
event_set_active_player.proto event_set_active_player.proto
event_set_card_attr.proto event_set_card_attr.proto
event_set_card_counter.proto event_set_card_counter.proto
event_set_counter.proto event_set_counter.proto
event_shuffle.proto event_shuffle.proto
event_stop_dump_zone.proto event_stop_dump_zone.proto
event_user_joined.proto event_user_joined.proto
event_user_left.proto event_user_left.proto
event_user_message.proto event_user_message.proto
game_commands.proto game_commands.proto
game_event_container.proto game_event_container.proto
game_event_context.proto game_event_context.proto
game_event.proto game_event.proto
game_replay.proto game_replay.proto
isl_message.proto isl_message.proto
moderator_commands.proto moderator_commands.proto
move_card_to_zone.proto move_card_to_zone.proto
response_deck_download.proto response_deck_download.proto
response_deck_list.proto response_deck_list.proto
response_deck_upload.proto response_deck_upload.proto
response_dump_zone.proto response_dump_zone.proto
response_get_games_of_user.proto response_get_games_of_user.proto
response_get_user_info.proto response_get_user_info.proto
response_join_room.proto response_join_room.proto
response_list_users.proto response_list_users.proto
response_login.proto response_login.proto
response_replay_download.proto response_replay_download.proto
response_replay_list.proto response_replay_list.proto
response.proto response.proto
room_commands.proto room_commands.proto
room_event.proto room_event.proto
serverinfo_arrow.proto serverinfo_arrow.proto
serverinfo_cardcounter.proto serverinfo_cardcounter.proto
serverinfo_card.proto serverinfo_card.proto
serverinfo_counter.proto serverinfo_counter.proto
serverinfo_deckstorage.proto serverinfo_deckstorage.proto
serverinfo_game.proto serverinfo_game.proto
serverinfo_gametype.proto serverinfo_gametype.proto
serverinfo_playerping.proto serverinfo_playerping.proto
serverinfo_playerproperties.proto serverinfo_playerproperties.proto
serverinfo_player.proto serverinfo_player.proto
serverinfo_replay.proto serverinfo_replay.proto
serverinfo_replay_match.proto serverinfo_replay_match.proto
serverinfo_room.proto serverinfo_room.proto
serverinfo_user.proto serverinfo_user.proto
serverinfo_zone.proto serverinfo_zone.proto
server_message.proto server_message.proto
session_commands.proto session_commands.proto
session_event.proto session_event.proto
) )
include_directories(${PROTOBUF_INCLUDE_DIRS}) include_directories(${PROTOBUF_INCLUDE_DIRS})
@ -155,6 +155,6 @@ PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS}) add_library(cockatrice_protocol ${PROTO_SRCS} ${PROTO_HDRS})
set(cockatrice_protocol_LIBS ${PROTOBUF_LIBRARIES}) set(cockatrice_protocol_LIBS ${PROTOBUF_LIBRARIES})
if (MSVC) if (MSVC)
set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lprotobuf) set(cockatrice_protocol_LIBS ${cockatrice_protocol_LIBS} -lprotobuf)
endif (MSVC) endif (MSVC)
target_link_libraries(cockatrice_protocol ${cockatrice_protocol_LIBS}) target_link_libraries(cockatrice_protocol ${cockatrice_protocol_LIBS})

View file

@ -8,11 +8,11 @@ PROJECT(oracle)
set(DESKTOPDIR share/applications CACHE STRING "path to .desktop files") set(DESKTOPDIR share/applications CACHE STRING "path to .desktop files")
SET(oracle_SOURCES SET(oracle_SOURCES
src/main.cpp src/main.cpp
src/oracleimporter.cpp src/oracleimporter.cpp
src/window_main.cpp src/window_main.cpp
../cockatrice/src/carddatabase.cpp ../cockatrice/src/carddatabase.cpp
../cockatrice/src/settingscache.cpp ../cockatrice/src/settingscache.cpp
) )
SET(QT_USE_QTNETWORK TRUE) SET(QT_USE_QTNETWORK TRUE)
@ -28,45 +28,45 @@ ADD_EXECUTABLE(oracle WIN32 MACOSX_BUNDLE ${oracle_SOURCES} ${oracle_MOC_SRCS})
TARGET_LINK_LIBRARIES(oracle ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(oracle ${QT_LIBRARIES})
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
INSTALL(TARGETS oracle BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS oracle BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
else() else()
# Assume linux # Assume linux
INSTALL(TARGETS oracle RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL(TARGETS oracle RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif() endif()
elseif(WIN32) elseif(WIN32)
INSTALL(TARGETS oracle RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS oracle RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
endif() endif()
IF (NOT WIN32 AND NOT APPLE) IF (NOT WIN32 AND NOT APPLE)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/oracle.desktop DESTINATION ${DESKTOPDIR}) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/oracle.desktop DESTINATION ${DESKTOPDIR})
ENDIF (NOT WIN32 AND NOT APPLE) ENDIF (NOT WIN32 AND NOT APPLE)
if(APPLE) #if(APPLE)
set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Plugins) # set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Plugins)
set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Resources) # set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Resources)
# note: no codecs in qt5 # note: no codecs in qt5
# note: phonon_backend => mediaservice # note: phonon_backend => mediaservice
# note: needs platform on osx # note: needs platform on osx
if (CMAKE_BUILD_TYPE STREQUAL "Debug") # if (CMAKE_BUILD_TYPE STREQUAL "Debug")
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime # install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib") # FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib")
else() # else()
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime # install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib") # FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib")
endif() # endif()
install(CODE " # install(CODE "
file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths] # file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths]
Plugins = Plugins\") #Plugins = Plugins\")
" COMPONENT Runtime) # " COMPONENT Runtime)
install(CODE " # install(CODE "
file(GLOB_RECURSE QTPLUGINS # file(GLOB_RECURSE QTPLUGINS
\"${plugin_dest_dir}/*.dylib\") # \"${plugin_dest_dir}/*.dylib\")
include(BundleUtilities) # include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/oracle.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") # fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/oracle.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
" COMPONENT Runtime) # " COMPONENT Runtime)
endif() #endif()

View file

@ -9,15 +9,15 @@ SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
FIND_PACKAGE(Libgcrypt REQUIRED) FIND_PACKAGE(Libgcrypt REQUIRED)
SET(servatrice_SOURCES SET(servatrice_SOURCES
src/main.cpp src/main.cpp
src/passwordhasher.cpp src/passwordhasher.cpp
src/servatrice.cpp src/servatrice.cpp
src/servatrice_connection_pool.cpp src/servatrice_connection_pool.cpp
src/servatrice_database_interface.cpp src/servatrice_database_interface.cpp
src/server_logger.cpp src/server_logger.cpp
src/serversocketinterface.cpp src/serversocketinterface.cpp
src/isl_interface.cpp src/isl_interface.cpp
${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp ${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp
) )
SET(QT_DONTUSE_QTGUI) SET(QT_DONTUSE_QTGUI)
@ -38,47 +38,76 @@ TARGET_LINK_LIBRARIES(servatrice cockatrice_common ${QT_LIBRARIES} ${LIBGCRYPT_L
#add_custom_target(versionheader ALL DEPENDS version_header) #add_custom_target(versionheader ALL DEPENDS version_header)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_string.h ${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_string.h ${CMAKE_CURRENT_BINARY_DIR}/version_string.cpp
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/../common/getversion.cmake COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/../common/getversion.cmake
) )
# install rules # install rules
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
INSTALL(TARGETS servatrice BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS servatrice BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
else() else()
# Assume linux # Assume linux
INSTALL(TARGETS servatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) INSTALL(TARGETS servatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif() endif()
elseif(WIN32) elseif(WIN32)
INSTALL(TARGETS servatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) INSTALL(TARGETS servatrice RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
endif() endif()
if(APPLE) if(APPLE)
set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/servatrice.app/Contents/Plugins) set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/servatrice.app/Contents/Plugins)
set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/servatrice.app/Contents/Resources) set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/servatrice.app/Contents/Resources)
# note: no codecs in qt5 # note: no codecs in qt5
# note: phonon_backend => mediaservice # note: phonon_backend => mediaservice
# note: needs platform on osx # note: needs platform on osx
if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (CMAKE_BUILD_TYPE STREQUAL "Debug")
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib") FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib")
else() else()
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib") FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib")
endif() endif()
install(CODE " install(CODE "
file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths] file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths]
Plugins = Plugins\") Plugins = Plugins\")
" COMPONENT Runtime) " COMPONENT Runtime)
install(CODE " install(CODE "
file(GLOB_RECURSE QTPLUGINS file(GLOB_RECURSE QTPLUGINS
\"${plugin_dest_dir}/*.dylib\") \"${plugin_dest_dir}/*.dylib\")
include(BundleUtilities) include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\") fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/servatrice.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
" COMPONENT Runtime) " COMPONENT Runtime)
endif() endif()
if(APPLE)
set(plugin_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Plugins)
set(qtconf_dest_dir ${CMAKE_INSTALL_PREFIX}/oracle.app/Contents/Resources)
# note: no codecs in qt5
# note: phonon_backend => mediaservice
# note: needs platform on osx
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/.*_debug\\.dylib")
else()
install(DIRECTORY "${QT_PLUGINS_DIR}/" DESTINATION ${plugin_dest_dir} COMPONENT Runtime
FILES_MATCHING REGEX "(codecs|iconengines|imageformats|mediaservice|phonon_backend|platforms)/[^_]*\\.dylib")
endif()
install(CODE "
file(WRITE \"${qtconf_dest_dir}/qt.conf\" \"[Paths]
Plugins = Plugins\")
" COMPONENT Runtime)
install(CODE "
file(GLOB_RECURSE QTPLUGINS
\"${plugin_dest_dir}/*.dylib\")
include(BundleUtilities)
fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/oracle.app\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIR}\")
" COMPONENT Runtime)
endif()