Skip to content

Commit

Permalink
cmake: Initialize submodules slightly earlier
Browse files Browse the repository at this point in the history
Move `git submodule init` calls to before the `AUTO_UPDATE_EXTERNALS`
block so that logic that requires initialized submodules can be added to
that block later.
  • Loading branch information
bradking committed Jun 29, 2016
1 parent 9d95e56 commit 7750756
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ foreach(proj ${EXTERNAL_PROJECTS})
# Compute the path to the submodule for this external.
file(RELATIVE_PATH ${proj}_GIT_SUBMODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${${proj}_SOURCE_DIR})

# Initialize the submodule configuration now so parallel downloads do not conflict later.
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init -- ${${proj}_GIT_SUBMODULE_PATH}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# Download externals as Git submodules.
set(${proj}_DOWNLOAD_COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- ${${proj}_GIT_SUBMODULE_PATH})

Expand All @@ -341,10 +345,6 @@ foreach(proj ${EXTERNAL_PROJECTS})
set(${proj}_UPDATE_COMMAND "")
endif()

# Initialize the submodule configuration now so parallel downloads do not conflict later.
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init -- ${${proj}_GIT_SUBMODULE_PATH}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# now the actual project
if(${proj}_IS_CMAKE_POD)
if(NOT ${proj}_BINARY_DIR)
Expand Down Expand Up @@ -488,6 +488,10 @@ foreach(example IN ITEMS LittleDog)
if(EXAMPLES_${example_upper})
message(STATUS "Installation will include extra example: ${example}")

# Initialize the submodule configuration now so parallel downloads do not conflict later.
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init -- drake/examples/${example}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# Download examples as Git submodules.
set(${example}_DOWNLOAD_COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- drake/examples/${example})
if(AUTO_UPDATE_EXTERNALS)
Expand All @@ -507,10 +511,6 @@ foreach(example IN ITEMS LittleDog)
drake_forceupdate(download-${example})
add_dependencies(drake download-${example})
add_dependencies(download-all download-${example})

# Initialize the submodule configuration now so parallel downloads do not conflict later.
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init -- drake/examples/${example}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
endforeach()

Expand Down

0 comments on commit 7750756

Please sign in to comment.