--- a/CMakeLists.txt Mon Mar 04 22:58:01 2013 +0100
+++ b/CMakeLists.txt Mon Mar 04 23:11:28 2013 +0100
@@ -49,8 +49,8 @@
)
#check local repo status
string(REGEX REPLACE "[^+]" "" HGCHANGED ${internal_version})
- string(REGEX REPLACE "[0-9a-zA-Z]+(.*) ([0-9]+)(.*)" "\\2" revision_number ${internal_version})
- string(REGEX REPLACE "([0-9a-zA-Z]+)(.*) [0-9]+(.*)" "\\1" hash_number ${internal_version})
+ string(REGEX REPLACE "[0-9a-zA-Z]+(.*) ([0-9]+)(.*)" "\\2" HEDGEWARS_REVISION ${internal_version})
+ string(REGEX REPLACE "([0-9a-zA-Z]+)(.*) [0-9]+(.*)" "\\1" HEDGEWARS_HASH ${internal_version})
if(HGCHANGED)
message(${WARNING} "You have uncommitted changes in your repository!")
@@ -58,21 +58,21 @@
#let's assume that if you have hg you might be interested in debugging
set(default_build_type "DEBUG")
#write down hash and rev for easy picking should hg be missing
- file(WRITE "${CMAKE_SOURCE_DIR}/share/version_info.txt" "Hedgewars versioning information, do not modify\nrev ${revision_number}\nhash ${hash_number}\n")
+ file(WRITE "${CMAKE_SOURCE_DIR}/share/version_info.txt" "Hedgewars versioning information, do not modify\nrev ${HEDGEWARS_REVISION}\nhash ${HEDGEWARS_HASH}\n")
else()
set(default_build_type "RELEASE")
# when compiling outside rev control, fetch revision and hash information from version_info.txt
find_file(version_info version_info.txt PATH ${CMAKE_SOURCE_DIR}/share)
if(version_info)
file(STRINGS ${version_info} internal_version REGEX "rev")
- string(REGEX REPLACE "rev ([0-9]*)" "\\1" revision_number ${internal_version})
+ string(REGEX REPLACE "rev ([0-9]*)" "\\1" HEDGEWARS_REVISION ${internal_version})
file(STRINGS ${version_info} internal_version REGEX "hash")
- string(REGEX REPLACE "hash ([a-zA-Z0-9]*)" "\\1" hash_number ${internal_version})
+ string(REGEX REPLACE "hash ([a-zA-Z0-9]*)" "\\1" HEDGEWARS_HASH ${internal_version})
else()
message(${WARNING} "${CMAKE_SOURCE_DIR}/share/version_info.txt not found, revision information "
"will be incorrect!!! Contact your source provider to fix this!")
- set(revision_number "0000")
- set(hash_number "unknown")
+ set(HEDGEWARS_REVISION "0000")
+ set(HEDGEWARS_HASH "unknown")
endif()
endif()
@@ -84,7 +84,7 @@
set(HEDGEWARS_PROTO_VER 44)
set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
-message(STATUS "Building ${HEDGEWARS_VERSION}-r${revision_number} (${hash_number})")
+message(STATUS "Building ${HEDGEWARS_VERSION}-r${HEDGEWARS_REVISION} (${HEDGEWARS_HASH})")
#where to build libs and bins
--- a/QTfrontend/hwconsts.cpp.in Mon Mar 04 22:58:01 2013 +0100
+++ b/QTfrontend/hwconsts.cpp.in Mon Mar 04 23:11:28 2013 +0100
@@ -25,8 +25,8 @@
QString * cDataDir = new QString("${HEDGEWARS_DATADIR}");
QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
QString * cVersionString = new QString("${HEDGEWARS_VERSION}");
-QString * cRevisionString = new QString("${revision_number}");
-QString * cHashString = new QString("${hash_number}");
+QString * cRevisionString = new QString("${HEDGEWARS_REVISION}");
+QString * cHashString = new QString("${HEDGEWARS_HASH}");
QDir * bindir = new QDir();
--- a/hedgewars/config.inc.in Mon Mar 04 22:58:01 2013 +0100
+++ b/hedgewars/config.inc.in Mon Mar 04 23:11:28 2013 +0100
@@ -23,7 +23,7 @@
*)
const cNetProtoVersion = ${HEDGEWARS_PROTO_VER};
cVersionString = '${HEDGEWARS_VERSION}';
- cRevisionString = '${revision_number}';
- cHashString = '${hash_number}';
+ cRevisionString = '${HEDGEWARS_REVISION}';
+ cHashString = '${HEDGEWARS_HASH}';
cLuaLibrary = '${LUA_LIBRARY}';
cDefaultPathPrefix = '${HEDGEWARS_FULL_DATADIR}/Data';
--- a/share/CMakeLists.txt Mon Mar 04 22:58:01 2013 +0100
+++ b/share/CMakeLists.txt Mon Mar 04 23:11:28 2013 +0100
@@ -4,13 +4,8 @@
add_subdirectory(hedgewars/Data)
if(APPLE)
- #needed for CFBundleVersion and CFBundleShortVersionString
- #should reuse the variables set in main CMakeLists.txt
- if(HGCOMMAND AND (EXISTS ${CMAKE_SOURCE_DIR}/.hg))
- set(HEDGEWARS_REVISION ${revision_number})
- else()
- set(HEDGEWARS_REVISION ${HEDGEWARS_VERSION})
- endif()
+ #CFBundleVersion is HEDGEWARS_REVISION
+ #CFBundleShortVersionString is HEDGEWARS_VERSION
#silly libav that always brings in VideoDecoderAcceleration, avaible only from 10.6.3
if(NOT NOVIDEOREC)