Use constant generated by cmake for version string
authorunc0rr
Tue, 06 May 2008 15:13:02 +0000 (2008-05-06)
changeset 907 a5b0b93a39c8
parent 906 1cc10dde304c
child 908 9b79dd99cde1
Use constant generated by cmake for version string
CMakeLists.txt
QTfrontend/about.cpp
QTfrontend/hwconsts.cpp.in
QTfrontend/hwconsts.h
hedgewars/hwengine.dpr
hedgewars/proto.inc.in
--- a/CMakeLists.txt	Tue May 06 15:00:03 2008 +0000
+++ b/CMakeLists.txt	Tue May 06 15:13:02 2008 +0000
@@ -2,6 +2,10 @@
 
 cmake_minimum_required(VERSION 2.4.4 FATAL_ERROR)
 
+set(CPACK_PACKAGE_VERSION_MAJOR "0")
+set(CPACK_PACKAGE_VERSION_MINOR "9")
+set(CPACK_PACKAGE_VERSION_PATCH "4-dev")
+
 if(DEFINED DATA_INSTALL_DIR)
 	set(SHAREPATH ${DATA_INSTALL_DIR}/hedgewars/)
 else(DEFINED DATA_INSTALL_DIR)
@@ -9,6 +13,7 @@
 endif(DEFINED DATA_INSTALL_DIR)
 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
 
+set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
 set(HEDGEWARS_PROTO_VER 11)
 
 add_subdirectory(bin)
@@ -20,14 +25,11 @@
 
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hedgewars, a turn-based strategy")
 set(CPACK_PACKAGE_VENDOR "Hedgewars")
-set(CPACK_PACKAGE_VERSION_MAJOR "0")
-set(CPACK_PACKAGE_VERSION_MINOR "9")
-set(CPACK_PACKAGE_VERSION_PATCH "3")
-set(CPACK_PACKAGE_FILE_NAME "hedgewars-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
-set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+set(CPACK_PACKAGE_FILE_NAME "hedgewars-${HEDGEWARS_VERSION}")
+set(CPACK_SOURCE_PACKAGE_FILE_NAME "hedgewars-src-${HEDGEWARS_VERSION}")
 set(CPACK_PACKAGE_EXECUTABLES "hedgewars" "hedgewars")
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "Hedgewars ${HEDGEWARS_VERSION}")
 
 if(WIN32 AND NOT UNIX)
 	set(CPACK_NSIS_DISPLAY_NAME "Hedgewars, a turn-based Worms-like strategy") 
--- a/QTfrontend/about.cpp	Tue May 06 15:00:03 2008 +0000
+++ b/QTfrontend/about.cpp	Tue May 06 15:13:02 2008 +0000
@@ -21,6 +21,7 @@
 #include <QLabel>
 #include <QTextBrowser>
 #include "about.h"
+#include "hwconsts.h"
 
 About::About(QWidget * parent) :
   QWidget(parent)
@@ -34,8 +35,8 @@
 
 	lbl1->setOpenExternalLinks(true);
 	lbl1->setText(
-			"<div align=\"center\"><h1>Hedgewars</h1>" +
-			QLabel::tr("<h3>Version 0.9.3</h3>") +
+			"<div align=\"center\"><h1>Hedgewars</h1>"
+			"<h3>" + QLabel::tr("Version") + " " + *cVersionString + "</h3>"
 			"<p><a href=\"http://www.hedgewars.org/\">http://www.hedgewars.org/</a></p><br>" +
 			QLabel::tr("This program is distributed under the GNU General Public License") +
 			"</div>"
--- a/QTfrontend/hwconsts.cpp.in	Tue May 06 15:00:03 2008 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Tue May 06 15:13:02 2008 +0000
@@ -20,6 +20,7 @@
 
 QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
 QString * cDataDir = new QString("${HEDGEWARS_DATADIR}");
+QString * cVersionString = new QString("${HEDGEWARS_VERSION}");
 
 QDir * bindir = new QDir("${HEDGEWARS_BINDIR}");
 QDir * cfgdir = new QDir();
--- a/QTfrontend/hwconsts.h	Tue May 06 15:00:03 2008 +0000
+++ b/QTfrontend/hwconsts.h	Tue May 06 15:13:02 2008 +0000
@@ -22,6 +22,7 @@
 #include <QColor>
 
 extern QString * cProtoVer;
+extern QString * cVersionString;
 extern QString * cDataDir;
 
 extern QDir * bindir;
--- a/hedgewars/hwengine.dpr	Tue May 06 15:00:03 2008 +0000
+++ b/hedgewars/hwengine.dpr	Tue May 06 15:13:02 2008 +0000
@@ -291,7 +291,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 begin
-WriteLnToConsole('-= HedgeWars 0.9.3 =-');
+WriteLnToConsole('-= Hedgewars ' + cVersionString + ' =-');
 WriteLnToConsole('   -= by unC0Rr =-   ');
 GetParams;
 Randomize;
--- a/hedgewars/proto.inc.in	Tue May 06 15:00:03 2008 +0000
+++ b/hedgewars/proto.inc.in	Tue May 06 15:13:02 2008 +0000
@@ -17,3 +17,4 @@
  *)
 
 const cNetProtoVersion = ${HEDGEWARS_PROTO_VER};
+      cVersionString = '${HEDGEWARS_VERSION}';