Skip to content

Commit

Permalink
ENH: Automatically download submodules.
Browse files Browse the repository at this point in the history
Suggested-by: David Doria <daviddoria@gmail.com>
  • Loading branch information
thewtex committed Nov 13, 2012
1 parent 6d27f78 commit 5faf496
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ set( ITKExamples_RELEASE_VERSION
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITKExamples_BINARY_DIR}/bin )

# -------------------------------------------------------------------------
# Check to make sure the submodules have been created.
if( NOT EXISTS "${ITKExamples_SOURCE_DIR}/Utilities/SphinxExtensions/breathelink/.git" )
message( SEND_ERROR "The git submodules are not available. Please run
git submodule update --init --recursive"
)
endif()

if( NOT EXISTS "${ITKExamples_SOURCE_DIR}/Utilities/SphinxExtensions/breathe/.git" )
message( SEND_ERROR "The git submodules are not available. Please run
git submodule update --init --recursive"
# Check to make sure the submodules are available
find_package( Git )
# The UPDATING_SUBMODULES variable can be set to prevent CMake from running
# 'git submodule update' when attempting change the commit a submodule points
# to.
option( UPDATING_SUBMODULES
"Set to ON when updating one of the Git submodules." OFF )
if( EXISTS "${ITKExamples_SOURCE_DIR}/.git" AND GIT_EXECUTABLE AND NOT "${UPDATING_SUBMODULES}" )
execute_process( COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY "${ITKExamples_SOURCE_DIR}"
OUTPUT_QUIET
)
endif()

if( NOT EXISTS "${ITKExamples_SOURCE_DIR}/Utilities/SphinxExtensions/gitstats/.git" )
if( NOT EXISTS "${ITKExamples_SOURCE_DIR}/Utilities/SphinxExtensions/breathelink/.git" )
message( SEND_ERROR "The git submodules are not available. Please run
git submodule update --init --recursive"
)
Expand Down

0 comments on commit 5faf496

Please sign in to comment.