Skip to content

Commit

Permalink
cmake: Automatically sync submodule URL changes
Browse files Browse the repository at this point in the history
When AUTO_UPDATE_EXTERNALS is ON we are responsible for keeping
external source trees up to date.  Use `git submodule sync` to
honor changes to the submodule URLs.

Fixes RobotLocomotion#2694.
  • Loading branch information
bradking committed Jun 29, 2016
1 parent 7750756 commit d616855
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ foreach(proj ${EXTERNAL_PROJECTS})

if(AUTO_UPDATE_EXTERNALS)
set(${proj}_UPDATE_COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR} ${${proj}_DOWNLOAD_COMMAND})

# Synchronize the submodule url now so parallel updates do not conflict later.
execute_process(COMMAND ${GIT_EXECUTABLE} submodule sync -- ${${proj}_GIT_SUBMODULE_PATH}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
set(${proj}_UPDATE_COMMAND "")
endif()
Expand Down Expand Up @@ -496,6 +500,10 @@ foreach(example IN ITEMS LittleDog)
set(${example}_DOWNLOAD_COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- drake/examples/${example})
if(AUTO_UPDATE_EXTERNALS)
set(${example}_UPDATE_COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR} ${${example}_DOWNLOAD_COMMAND})

# Synchronize the submodule url now so parallel updates do not conflict later.
execute_process(COMMAND ${GIT_EXECUTABLE} submodule sync -- drake/examples/${example}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
set(${example}_UPDATE_COMMAND "")
endif()
Expand Down

0 comments on commit d616855

Please sign in to comment.