Improve the autorevision in cmake.

It now sets its default based on an initial testrun.
This commit is contained in:
Mark de Wever 2013-03-30 17:29:34 +01:00
parent 1c11e30edc
commit b2353cc016
2 changed files with 28 additions and 5 deletions

View File

@ -82,12 +82,34 @@ option(ENABLE_NLS "Enable building of translations" ON)
option(ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF)
option(ENABLE_OMP "Enables OpenMP, and has additional dependencies" OFF)
if(NOT UNIX)
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
else()
# TODO test whether can be enabled by default
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
if(NOT DEFINED ENABLE_DISPLAY_REVISION)
# Test whether the code is used in a repository if not autorevision will
# fail and should be disabled by default. If inside a repository enable
# the display of revision numbers by default.
execute_process(
COMMAND
${CMAKE_SOURCE_DIR}/utils/autorevision
-th
> ${CMAKE_CURRENT_BINARY_DIR}/revision.dummy
WORKING_DIRECTORY
${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE
ENABLE_DISPLAY_REVISION_TEST_OUTPUT
ERROR_VARIABLE
ENABLE_DISPLAY_REVISION_TEST_ERRNO
)
if("${ENABLE_DISPLAY_REVISION_TEST_ERRNO}" STREQUAL "")
set(DEFAULT_ENABLE_DISPLAY_REVISION true)
else()
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
endif()
unset(ENABLE_DISPLAY_REVISION_TEST_OUTPUT)
unset(ENABLE_DISPLAY_REVISION_TEST_ERRNO)
endif()
option(
ENABLE_DISPLAY_REVISION
"Enable the display of the revision number in the game, only enable it when in a checkout"

View File

@ -3,6 +3,7 @@ Version 1.11.2+dev:
* Updated translations: Indonesian, Portuguese, Vietnamese
* Miscellaneous and bug fixes
* Switched to git version control. Hosting moved to SourceForge
* Improved: Autorevision based revision numbers in CMake.
Version 1.11.2:
* Add-ons client: