share/CMakeLists.txt
changeset 4360 6cdb427ef82c
parent 2641 b08cafb86797
child 5172 88f2e05288ba
--- a/share/CMakeLists.txt	Sat Nov 27 23:29:07 2010 +0100
+++ b/share/CMakeLists.txt	Sun Nov 28 01:58:43 2010 +0100
@@ -1,6 +1,19 @@
 add_subdirectory(hedgewars)
 
 IF(APPLE)
+	#needed for CFBundleVersion and CFBundleShortVersionString
+	FIND_PROGRAM(HGCOMMAND hg)
+	IF (HGCOMMAND AND (EXISTS ${hedgewars_SOURCE_DIR}/.hg))
+		exec_program(${HGCOMMAND}
+			     ARGS identify -n ${hedgewars_SOURCE_DIR}
+			     OUTPUT_VARIABLE version_suffix
+			     )
+		STRING(REGEX REPLACE "([0-9]+)(.*)" "\\1" version_suffix ${version_suffix})
+		set (HEDGEWARS_REVISION ${version_suffix})
+	ELSE ()
+		set (HEDGEWARS_REVISION ${HEDGEWARS_VERSION})
+	ENDIF ()
+
 	configure_file(${hedgewars_SOURCE_DIR}/share/Info.plist.in 
 		${CMAKE_CURRENT_BINARY_DIR}/Info.plist)
 	install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/Info.plist"