Commit 29eae7f1 authored by bonnell's avatar bonnell
Browse files

fix retrieval of SVN revsion number via TortoiseSVN on windows.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@10856 18c085ea-50e0-402c-830e-de6fd14e8384
parent e8b39239
......@@ -14,7 +14,13 @@
# TortoiseSVN_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Current revision is ${Project_WC_REVISION}")
# ENDIF(TortoiseSVN_FOUND)
#
#------------------------------------------------------------------------------
# Modifications:
# Kathleen Bonnell, Wed Apr 14 16:15:23 MST 2010
# Use "SubWCRev WorkingCopyPath SrcVersionFile DstVersionFile" version of
# command to extract revision number. More consistent results this way.
#------------------------------------------------------------------------------
SET(TortoiseSVN_FOUND FALSE)
......@@ -26,22 +32,21 @@ IF(TortoiseSVN_EXECUTABLE)
SET(TortoiseSVN_FOUND TRUE)
MACRO(TortoiseSVN_WC_INFO dir prefix)
EXECUTE_PROCESS(COMMAND ${TortoiseSVN_EXECUTABLE} ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
FILE(WRITE "${VISIT_SOURCE_DIR}/svnrev.in" "$WCREV$")
EXECUTE_PROCESS(COMMAND ${TortoiseSVN_EXECUTABLE} "." "${VISIT_SOURCE_DIR}/svnrev.in" "${VISIT_SOURCE_DIR}/svnrev"
WORKING_DIRECTORY ${VISIT_SOURCE_DIR}
OUTPUT_VARIABLE TortoiseSVN_info_output
ERROR_VARIABLE TortoiseSVN_info_error
RESULT_VARIABLE TortoiseSVN_info_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT ${TortoiseSVN_info_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${TortoiseSVN_EXECUTABLE} info ${dir}\" failed with output:\n${TortoiseSVN_info_error}")
MESSAGE(SEND_ERROR "Command \"${TortoiseSVN_EXECUTABLE} ${dir}\" failed with output:\n${TortoiseSVN_info_error}")
ELSE(NOT ${TortoiseSVN_info_result} EQUAL 0)
STRING(REGEX REPLACE "^(.*\n)?Updated to revision ([^\n]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
FILE(STRINGS ${VISIT_SOURCE_DIR}/svnrev ${prefix}_WC_REVISION)
ENDIF(NOT ${TortoiseSVN_info_result} EQUAL 0)
FILE(REMOVE ${VISIT_SOURCE_DIR}/svnrev.in ${VISIT_SOURCE_DIR}/svnrev)
ENDMACRO(TortoiseSVN_WC_INFO)
ENDIF(TortoiseSVN_EXECUTABLE)
......
......@@ -95,6 +95,9 @@
# Find MakeNSIS on windows. Add PACKAGE target for windows, that uses
# our NSIS scripts to create the self-installer.
#
# Kathleen Bonnell, Wed April 14 16:33:27 MST 2010
# Renable FindTortoiseSVN on windows to retrieve SVN revision number.
#
#****************************************************************************/
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
......@@ -1055,11 +1058,11 @@ ELSE(EXISTS SVN_REVISION)
IF(WIN32)
# THIS NEEDS TO BE UPDATED: FindTortoiseSVN.cmake needs to use
# keyword substituion and templates!@
# INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindTortoiseSVN.cmake)
# IF(TortoiseSVN_FOUND)
# TortoiseSVN_WC_INFO(${PROJECT_SOURCE_DIR} VISIT)
# SET(VISIT_SVN_REVISION "${VISIT_WC_REVISION}")
# ENDIF(TortoiseSVN_FOUND)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindTortoiseSVN.cmake)
IF(TortoiseSVN_FOUND)
TortoiseSVN_WC_INFO(${PROJECT_SOURCE_DIR} VISIT)
SET(VISIT_SVN_REVISION "${VISIT_WC_REVISION}")
ENDIF(TortoiseSVN_FOUND)
ENDIF(WIN32)
ENDIF(Subversion_FOUND)
ENDIF(EXISTS SVN_REVISION)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment