Skip to content
Browse files

BUG: Display warning message when no git origin is set only when requ…

…ired

The warning message displayed only if it's a git repository that
has the following properties:
 - No remote.origin is set
 - it's NOT a git svn repo

This will prevent the message from being displayed when configuring Slicer:

CMake Warning at CMake/FindGit.cmake:108 (message):
  No remote origin set for git repository:
  /home/jchris/Projects/Slicer4/Extensions/CMake
Call Stack (most recent call first):
  CMake/SlicerMacroExtractRepositoryInfo.cmake:99 (GIT_WC_INFO)
  Extensions/CMake/CMakeLists.txt:73 (SlicerMacroExtractRepositoryInfo)

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20577 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
1 parent defd86d commit f3b9c59b03b33184b5d131e6d93788e0c4f8bdee @jcfr jcfr committed Jul 5, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 CMake/FindGit.cmake
View
17 CMake/FindGit.cmake
@@ -103,14 +103,6 @@ if(GIT_EXECUTABLE)
OUTPUT_VARIABLE ${prefix}_WC_URL
OUTPUT_STRIP_TRAILING_WHITESPACE)
- # If there is no 'remote.origin', default to "NA" value and print a warning message.
- if(NOT ${prefix}_WC_URL)
- message(WARNING "No remote origin set for git repository: ${dir}" )
- set( ${prefix}_WC_URL "NA" )
- else()
- set(${prefix}_WC_ROOT ${${prefix}_WC_URL})
- endif()
-
set(${prefix}_WC_GITSVN False)
# Check if this git is likely to be a git-svn repository
@@ -146,6 +138,15 @@ if(GIT_EXECUTABLE)
"\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
endif(${git_svn_info_result} EQUAL 0)
endif(NOT "${git_config_output}" STREQUAL "")
+
+ # If there is no 'remote.origin', default to "NA" value and print a warning message.
+ if(NOT ${prefix}_WC_URL)
+ message(WARNING "No remote origin set for git repository: ${dir}" )
+ set( ${prefix}_WC_URL "NA" )
+ else()
+ set(${prefix}_WC_ROOT ${${prefix}_WC_URL})
+ endif()
+
endmacro(GIT_WC_INFO)
endif(GIT_EXECUTABLE)

0 comments on commit f3b9c59

Please sign in to comment.
Something went wrong with that request. Please try again.