Commit dbe46084 authored by Antony Woods's avatar Antony Woods
Browse files

Merge branch 'master' of github.com:Daenyth/Cockatrice into auto-connect

parents ab83d618 2aeecc60
......@@ -102,7 +102,9 @@ ENDIF()
# Find Qt and enable the needed features
# Default is Qt5 unless WITH_QT4 option is enabled
option(WITH_QT4 "Force thr use of Qt4 libraries" OFF)
option(WITH_QT4 "Force the use of Qt4 libraries" OFF)
OPTION(UPDATE_TRANSLATIONS "Update translations on compile" OFF)
MESSAGE("UPDATE TRANSLATIONS: ${UPDATE_TRANSLATIONS}")
IF(NOT WITH_QT4)
FIND_PACKAGE(Qt5Widgets)
......@@ -114,7 +116,19 @@ IF(Qt5Widgets_FOUND)
if(UNIX AND NOT APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
# FIX: Qt was built with -reduce-relocations
add_definitions(-fPIC)
endif()
endif()
FIND_PACKAGE(Qt5LinguistTools)
IF(UPDATE_TRANSLATIONS)
IF(NOT Qt5_LUPDATE_EXECUTABLE)
MESSAGE(WARNING "Qt's lupdate not found.")
ENDIF()
ENDIF()
IF(NOT Qt5_LRELEASE_EXECUTABLE)
MESSAGE(WARNING "Qt's lrelease not found.")
ENDIF()
ELSE()
FIND_PACKAGE(Qt4 4.8.0 REQUIRED)
IF(QT4_FOUND)
......@@ -123,6 +137,17 @@ ELSE()
ENDIF()
IF(Qt4_FOUND)
MESSAGE(STATUS "Found Qt ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
IF(UPDATE_TRANSLATIONS)
IF(NOT QT_LUPDATE_EXECUTABLE)
MESSAGE(WARNING "Qt's lupdate not found.")
ENDIF()
ENDIF()
IF(NOT QT_LRELEASE_EXECUTABLE)
MESSAGE(WARNING "Qt's lrelease not found.")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "No Qt4 or Qt5 found!")
ENDIF()
......
# Cockatrice
[![Build Status](https://travis-ci.org/Daenyth/Cockatrice.svg?branch=master)](https://travis-ci.org/Daenyth/Cockatrice)
Cockatrice is an open-source multiplatform software for playing card games,
such as Magic: The Gathering, over a network. It is fully client-server based
to prevent any kind of cheating, though it supports single-player games without
a network interface as well. Both client and server are written in Qt 4.
a network interface as well. Both client and server are written in Qt, supporting both Qt4 and Qt5.
# License
# Get Involved
Cockatrice is free software, licensed under the GPLv2; see COPYING for details.
Chat with the Cockatrice developers on Gitter. Come here to talk about the application, features, or just to hang out. For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.
[![Gitter chat](https://badges.gitter.im/Daenyth/Cockatrice.png)](https://gitter.im/Daenyth/Cockatrice)
# Building
[![Build Status](https://travis-ci.org/Daenyth/Cockatrice.svg?branch=master)](https://travis-ci.org/Daenyth/Cockatrice)
Dependencies:
- [Qt](http://qt-project.org/)
......@@ -38,9 +40,14 @@ The following flags can be passed to `cmake`:
- `-DWITH_ORACLE=0` Do not build Oracle
- `-DWITH_QT4=1` Force compilation to use Qt4 instead of Qt5.
- `-DCMAKE_BUILD_TYPE=Debug` Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings.
- `-DUPDATE_TRANSLATIONS=1` Configure `make` to update the translation .ts files for new strings in the source code. Note: Running `make clean` will remove the .ts files. You should run this when contributing code that changes user messages. Translation file updates should be added in the same commit as the string that was changed.
# Running
`oracle` fetches card data
`cockatrice` is the game client
`servatrice` is the server
# License
Cockatrice is free software, licensed under the GPLv2; see COPYING for details.
......@@ -98,22 +98,13 @@ if (UNIX AND NOT APPLE)
endif (UNIX AND NOT APPLE)
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
translations/cockatrice_sv.ts
# translations/cockatrice_zh_CN.ts
)
FILE(GLOB cockatrice_TS "${CMAKE_CURRENT_SOURCE_DIR}/translations/*.ts")
IF(UPDATE_TRANSLATIONS)
FILE(GLOB_RECURSE translate_cockatrice_SRCS ${CMAKE_SOURCE_DIR}/cockatrice/src/*.cpp)
FILE(GLOB_RECURSE translate_common_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/common/*.cpp)
SET(translate_SRCS ${translate_cockatrice_SRCS} ${translate_common_SRCS})
ENDIF(UPDATE_TRANSLATIONS)
if(WIN32)
set(cockatrice_SOURCES ${cockatrice_SOURCES} cockatrice.rc)
......@@ -149,7 +140,12 @@ if(Qt4_FOUND)
# Let cmake chew Qt4's translations and resource files
# Note: header files are MOC-ed automatically by cmake
QT4_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
IF(UPDATE_TRANSLATIONS)
QT4_CREATE_TRANSLATION(cockatrice_QM ${translate_SRCS} ${cockatrice_TS})
ELSE(UPDATE_TRANSLATIONS)
QT4_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
ENDIF(UPDATE_TRANSLATIONS)
QT4_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
endif()
......@@ -202,7 +198,12 @@ if(Qt5Widgets_FOUND)
# Let cmake chew Qt5's translations and resource files
# Note: header files are MOC-ed automatically by cmake
QT5_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
IF(UPDATE_TRANSLATIONS)
QT5_CREATE_TRANSLATION(cockatrice_QM ${translate_SRCS} ${cockatrice_TS})
ELSE()
QT5_ADD_TRANSLATION(cockatrice_QM ${cockatrice_TS})
ENDIF()
QT5_ADD_RESOURCES(cockatrice_RESOURCES_RCC ${cockatrice_RESOURCES})
# guess plugins and libraries directory
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
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