From d6168552b3946433182f152f7876a7d8cfc76f4c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 29 Jun 2016 10:33:14 -0400 Subject: [PATCH] cmake: Automatically sync submodule URL changes 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 #2694. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index aa0f6da7fc9d..1ae168bf5453 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() @@ -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()