if source has uncommitted changes:
authorsheepluva
Wed, 02 Feb 2011 09:05:48 +0100
changeset 4903 21dd1def5aaf
parent 4902 45ec26ca9491
child 4904 0eab727d4717
if source has uncommitted changes: * show notice during build * append "++" to frontend's versionstring/titlebar/demo names/save names
CMakeLists.txt
QTfrontend/hwconsts.cpp.in
--- a/CMakeLists.txt	Wed Feb 02 07:40:36 2011 +0100
+++ b/CMakeLists.txt	Wed Feb 02 09:05:48 2011 +0100
@@ -9,6 +9,7 @@
 
 #detect Mercurial revision (if present)
 set(version_suffix "-dev") #UNSET THIS VARIABLE AT RELEASE TIME
+set(HGCHANGED "")
 IF(version_suffix MATCHES "-dev")
 	set(HW_DEV true)
 	IF (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.hg)
@@ -18,8 +19,13 @@
 				     ARGS identify -in ${CMAKE_CURRENT_SOURCE_DIR}
 				     OUTPUT_VARIABLE version_suffix
 				     )
+			STRING(REGEX REPLACE "[^+]" "" HGCHANGED ${version_suffix})
 			STRING(REGEX REPLACE "([0-9a-zA-Z]+)(.*) ([0-9]+)(.*)" "\\3:\\1" version_suffix ${version_suffix})
-			MESSAGE(STATUS "Building revision ${version_suffix}")
+			IF (HGCHANGED)
+				MESSAGE(STATUS "Building revision ${version_suffix} (SOURCE CODE MODIFIED)")
+			ELSE()
+				MESSAGE(STATUS "Building revision ${version_suffix}")
+			ENDIF()
 			set(version_suffix "-${version_suffix}")
 		ENDIF()
 	ENDIF()
--- a/QTfrontend/hwconsts.cpp.in	Wed Feb 02 07:40:36 2011 +0100
+++ b/QTfrontend/hwconsts.cpp.in	Wed Feb 02 09:05:48 2011 +0100
@@ -21,7 +21,7 @@
 QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
 QString * cDataDir = new QString("${HEDGEWARS_DATADIR}");
 QString * cConfigDir = new QString("");
-QString * cVersionString = new QString("${HEDGEWARS_VERSION}");
+QString * cVersionString = new QString("${HEDGEWARS_VERSION}${HGCHANGED}");
 
 QDir * bindir = new QDir("${HEDGEWARS_BINDIR}");
 QDir * cfgdir = new QDir();