From 747bd8d63d522449a8fab70707d3e4e2e806d69e Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Wed, 14 Jul 2010 10:53:20 +0800 Subject: [PATCH] Backed out changeset b55f3b8834f2 --- CMake/FindMercurial.cmake | 6 ++---- CMakeLists.txt | 28 +++++++++++++--------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/CMake/FindMercurial.cmake b/CMake/FindMercurial.cmake index 73f2d39066..3c06e485a2 100644 --- a/CMake/FindMercurial.cmake +++ b/CMake/FindMercurial.cmake @@ -11,7 +11,6 @@ SET(Mercurial_FOUND FALSE) SET(Mercurial_HG_FOUND FALSE) -SET(Mercurial_HG_PROJECT FALSE) FIND_PROGRAM(Mercurial_HG_EXECUTABLE hg DOC "mercurial command line client") @@ -44,15 +43,14 @@ IF(Mercurial_HG_EXECUTABLE) OUTPUT_STRIP_TRAILING_WHITESPACE) IF(NOT ${Mercurial_hg_identify_result} EQUAL 0) - #MESSAGE(WARNING "Command \"${Mercurial_HG_EXECUTABLE} identify ${dir}\" failed with output:\n${Mercurial_hg_identify_error}") - SET(Mercurial_HG_PROJECT FALSE) + MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} identify ${dir}\" failed with output:\n${Mercurial_hg_identify_error}") ELSE(NOT ${Mercurial_hg_identify_result} EQUAL 0) STRING(REGEX REPLACE "^(.*\n)?Mercurial Distributed SCM [(]version ([.0-9]+).*" "\\2" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}") STRING(REGEX REPLACE "^(.*\n)?([0-9a-f]+).*" "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_IDENTIFY}") - SET(Mercurial_HG_PROJECT TRUE) + ENDIF(NOT ${Mercurial_hg_identify_result} EQUAL 0) # restore the previous LC_ALL diff --git a/CMakeLists.txt b/CMakeLists.txt index 64faa657f7..969b58e359 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,21 +73,19 @@ SET(OTB_VERSION_PATCH "0") FIND_PACKAGE(Mercurial) IF(Mercurial_FOUND) Mercurial_WC_IDENTIFY(${PROJECT_SOURCE_DIR} OTB) - IF(Mercurial_HG_PROJECT) - MESSAGE(STATUS "Mercurial version is ${Mercurial_VERSION_HG}") - MESSAGE(STATUS "Repository revision is ${OTB_WC_REVISION}") - SET(OTB_WC_REVISION ${OTB_WC_REVISION} CACHE STRING "Repository version" FORCE) - MARK_AS_ADVANCED(OTB_WC_REVISION) - IF(OTB_WC_STATUS) - MESSAGE(STATUS "Local file modifications:") - MESSAGE(STATUS ${OTB_WC_STATUS}) - ELSE(OTB_WC_STATUS) - MESSAGE(STATUS "No files modified locally") - ENDIF(OTB_WC_STATUS) - STRING(REGEX REPLACE "\n" ";" OTB_WC_STATUS "${OTB_WC_STATUS}") - SET(OTB_WC_STATUS ${OTB_WC_STATUS} CACHE STRING "Repository status" FORCE) - MARK_AS_ADVANCED(OTB_WC_STATUS) - ENDIF(Mercurial_HG_PROJECT) + MESSAGE(STATUS "Mercurial version is ${Mercurial_VERSION_HG}") + MESSAGE(STATUS "Repository revision is ${OTB_WC_REVISION}") + SET(OTB_WC_REVISION ${OTB_WC_REVISION} CACHE STRING "Repository version" FORCE) + MARK_AS_ADVANCED(OTB_WC_REVISION) + IF(OTB_WC_STATUS) + MESSAGE(STATUS "Local file modifications:") + MESSAGE(STATUS ${OTB_WC_STATUS}) + ELSE(OTB_WC_STATUS) + MESSAGE(STATUS "No files modified locally") + ENDIF(OTB_WC_STATUS) + STRING(REGEX REPLACE "\n" ";" OTB_WC_STATUS "${OTB_WC_STATUS}") + SET(OTB_WC_STATUS ${OTB_WC_STATUS} CACHE STRING "Repository status" FORCE) + MARK_AS_ADVANCED(OTB_WC_STATUS) ENDIF(Mercurial_FOUND) # Version string should not include patch level. The major.minor is -- GitLab