summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2013-11-04 11:53:49 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2013-11-04 11:53:49 -0500
commit8188a8c410807debd2d7d40d0299c36b92e56ca3 (patch)
tree68a586a4f32bfd1f395c4942701813e002047622 /indra/cmake
parent2dbf6569a77c37d7c7ecc684dd417ddbbb7c6bab (diff)
parent6ed4c84a30e8f4044ccaedba114e13e07ae5c46d (diff)
merge
Diffstat (limited to 'indra/cmake')
-rwxr-xr-xindra/cmake/BuildVersion.cmake16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake
index 969670b1b9..e618a988b8 100755
--- a/indra/cmake/BuildVersion.cmake
+++ b/indra/cmake/BuildVersion.cmake
@@ -16,22 +16,26 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n
else (DEFINED ENV{revision})
find_program(MERCURIAL hg)
- if (DEFINED MERCURIAL)
+ find_program(WORDCOUNT wc)
+ find_program(SED sed)
+ if (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
execute_process(
- COMMAND ${MERCURIAL} log -r tip --template "{rev}"
+ COMMAND ${MERCURIAL} log -r tip:0 --template '\\n'
+ COMMAND ${WORDCOUNT} -l
+ COMMAND ${SED} "s/ //g"
OUTPUT_VARIABLE VIEWER_VERSION_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
message("Revision (from hg) ${VIEWER_VERSION_REVISION}")
else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
+ message("Revision not set (repository not found?); using 0")
set(VIEWER_VERSION_REVISION 0 )
- message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}")
endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
- else (DEFINED MERCURIAL)
+ else (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
+ message("Revision not set: 'hg', 'wc' or 'sed' not found; using 0")
set(VIEWER_VERSION_REVISION 0)
- message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}")
- endif (DEFINED MERCURIAL)
+ endif (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
endif (DEFINED ENV{revision})
message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
else ( EXISTS ${VIEWER_VERSION_BASE_FILE} )