mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
use 'git describe' to generate version info for the about box and servatrice. fixes issue #20
This commit is contained in:
parent
a1bcd9854f
commit
89bb8e72ee
10 changed files with 49 additions and 12 deletions
|
|
@ -2,8 +2,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|||
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
PROJECT(servatrice)
|
||||
|
||||
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../common ${CMAKE_CURRENT_BINARY_DIR}/common)
|
||||
|
||||
SET(servatrice_SOURCES
|
||||
src/main.cpp
|
||||
src/passwordhasher.cpp
|
||||
|
|
@ -11,6 +9,7 @@ SET(servatrice_SOURCES
|
|||
src/server_logger.cpp
|
||||
src/serversocketinterface.cpp
|
||||
src/serversocketthread.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../common/version_string.cpp
|
||||
)
|
||||
SET(servatrice_HEADERS
|
||||
src/servatrice.h
|
||||
|
|
@ -26,7 +25,8 @@ FIND_PACKAGE(Qt4 REQUIRED)
|
|||
FIND_PACKAGE(Protobuf REQUIRED)
|
||||
FIND_PACKAGE(Libgcrypt REQUIRED)
|
||||
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
#set(CMAKE_BUILD_TYPE Release)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O2")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
|
||||
|
||||
QT4_WRAP_CPP(servatrice_HEADERS_MOC ${servatrice_HEADERS})
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "servatrice.h"
|
||||
#include "server_logger.h"
|
||||
#include "rng_sfmt.h"
|
||||
#include "version_string.h"
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
|
@ -137,7 +138,7 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
rng = new RNG_SFMT;
|
||||
|
||||
std::cerr << "Servatrice " << Servatrice::versionString.toStdString() << " starting." << std::endl;
|
||||
std::cerr << "Servatrice " << VERSION_STRING << " starting." << std::endl;
|
||||
std::cerr << "-------------------------" << std::endl;
|
||||
|
||||
if (testRandom)
|
||||
|
|
|
|||
|
|
@ -630,5 +630,3 @@ void Servatrice::shutdownTimeout()
|
|||
if (!shutdownMinutes)
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
const QString Servatrice::versionString = "Servatrice 0.20111113";
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ private slots:
|
|||
void shutdownTimeout();
|
||||
public:
|
||||
mutable QMutex dbMutex;
|
||||
static const QString versionString;
|
||||
Servatrice(QSettings *_settings, QObject *parent = 0);
|
||||
~Servatrice();
|
||||
bool openDatabase();
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include "pb/serverinfo_user.pb.h"
|
||||
#include "pb/serverinfo_deckstorage.pb.h"
|
||||
|
||||
#include "version_string.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
|
|
@ -61,7 +62,7 @@ ServerSocketInterface::ServerSocketInterface(Servatrice *_server, QTcpSocket *_s
|
|||
|
||||
Event_ServerIdentification identEvent;
|
||||
identEvent.set_server_name(servatrice->getServerName().toStdString());
|
||||
identEvent.set_server_version(Servatrice::versionString.toStdString());
|
||||
identEvent.set_server_version(VERSION_STRING);
|
||||
identEvent.set_protocol_version(protocolVersion);
|
||||
SessionEvent *identSe = prepareSessionEvent(identEvent);
|
||||
sendProtocolItem(*identSe);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue