new cmake option NOVERSIONINFOUPDATE -- to be used if source is in a git/repo that is NOT the hedgewars repo
authorsheepluva
Mon, 20 Jan 2014 10:40:59 +0100
changeset 10025 ec966363adbe
parent 10024 7d21f52f0452
child 10026 14a3f7feeb39
new cmake option NOVERSIONINFOUPDATE -- to be used if source is in a git/repo that is NOT the hedgewars repo
CMakeLists.txt
cmake_modules/revinfo.cmake
--- a/CMakeLists.txt	Mon Jan 20 10:16:29 2014 +0100
+++ b/CMakeLists.txt	Mon Jan 20 10:40:59 2014 +0100
@@ -38,6 +38,8 @@
     set(DATA_INSTALL_DIR "share/hedgewars" CACHE STRING "Resource folder path")
 endif()
 
+option(NOVERSIONINFOUPDATE "Disable update of version_info.txt. To be used if source is in a git/repo that is NOT the hedgewars repo" OFF)
+
 #system paths for finding required fonts (see share/hedgewars/Data/fonts)
 #subdirectories will NOT be searched.
 #all fonts that can't be found will be bundled with hedgewars
--- a/cmake_modules/revinfo.cmake	Mon Jan 20 10:16:29 2014 +0100
+++ b/cmake_modules/revinfo.cmake	Mon Jan 20 10:40:59 2014 +0100
@@ -1,7 +1,7 @@
 #detect Mercurial revision and init rev/hash information
 find_program(HGCOMMAND hg)
 find_program(GITCOMMAND git)
-if(EXISTS ${CMAKE_SOURCE_DIR}/.hg AND HGCOMMAND)
+if(EXISTS ${CMAKE_SOURCE_DIR}/.hg AND HGCOMMAND AND NOT NOVERSIONINFOUPDATE)
     execute_process(COMMAND ${HGCOMMAND} identify -in
                     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
                     OUTPUT_VARIABLE internal_version
@@ -21,7 +21,7 @@
 
     #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 ${HEDGEWARS_REVISION}\nhash ${HEDGEWARS_HASH}\n")
-elseif(EXISTS ${CMAKE_SOURCE_DIR}/.git AND GITCOMMAND)
+elseif(EXISTS ${CMAKE_SOURCE_DIR}/.git AND GITCOMMAND AND NOT NOVERSIONINFOUPDATE)
     execute_process(COMMAND ${GITCOMMAND} rev-parse --short HEAD
                     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
                     OUTPUT_VARIABLE HEDGEWARS_HASH