From 3656ce7eacfd7ec08bb5bba08c822889ada98c45 Mon Sep 17 00:00:00 2001 From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org> Date: Sat, 22 May 2010 18:35:49 +0800 Subject: [PATCH] ENH: cmake warns of local file modifications --- CMake/FindMercurial.cmake | 6 ++++++ CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CMake/FindMercurial.cmake b/CMake/FindMercurial.cmake index befc72385f..3c06e485a2 100644 --- a/CMake/FindMercurial.cmake +++ b/CMake/FindMercurial.cmake @@ -36,6 +36,12 @@ IF(Mercurial_HG_EXECUTABLE) RESULT_VARIABLE Mercurial_hg_identify_result OUTPUT_STRIP_TRAILING_WHITESPACE) + EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} status -m ${dir} + OUTPUT_VARIABLE ${prefix}_WC_STATUS + ERROR_VARIABLE Mercurial_hg_status_error + RESULT_VARIABLE Mercurial_hg_status_result + OUTPUT_STRIP_TRAILING_WHITESPACE) + IF(NOT ${Mercurial_hg_identify_result} EQUAL 0) 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) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf64b84dd9..f9621ed403 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,12 @@ IF(Mercurial_FOUND) MESSAGE("Mercurial version is ${Mercurial_VERSION_HG}") MESSAGE("Repository revision is ${OTB_WC_REVISION}") SET(OTB_VERSION_STRING "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH}.${OTB_WC_REVISION}") + IF(OTB_WC_STATUS) + MESSAGE("Local file modifications:") + MESSAGE(${OTB_WC_STATUS}) + ELSE(OTB_WC_STATUS) + MESSAGE("No files modified locally") + ENDIF(OTB_WC_STATUS) ELSE(Mercurial_FOUND) # Version string should not include patch level. The major.minor is # enough to distinguish available features of the toolkit. -- GitLab