Merge topic 'ExternalProject_init_selected_submodules'

77ee6db5 Help: Add notes for topic 'ExternalProject_init_selected_submodules'
124243c0 ExternalProject: Add unit tests for GIT_SUBMODULES argument
14e2c3ad ExternalProject: Initialize only selected git submodules (#15590)
This commit is contained in:
Brad King 2015-06-08 10:34:49 -04:00 committed by CMake Topic Stage
commit 092133b1ba
4 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,7 @@
ExternalProject_init_selected_submodules
----------------------------------------
* The :module:`ExternalProject` module :command:`ExternalProject_Add`
function ``GIT_SUBMODULES`` option now also limits the set of
submodules that are initialized in addition to the prior behavior
of limiting the set of submodules that are updated.

View File

@ -529,7 +529,7 @@ if(error_code)
endif()
execute_process(
COMMAND \"${git_EXECUTABLE}\" submodule init
COMMAND \"${git_EXECUTABLE}\" submodule init ${git_submodules}
WORKING_DIRECTORY \"${work_dir}/${src_name}\"
RESULT_VARIABLE error_code
)

View File

@ -364,6 +364,66 @@ if(do_git_tests)
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
# Unzip/untar the git repository in our source folder so that other
# projects below may use it to test git args of ExternalProject_Add
#
set(proj SetupLocalGITRepositoryWithSubmodules)
ExternalProject_Add(${proj}
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT-with-submodules
URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo-sub.tgz
BUILD_COMMAND ""
CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
set_property(TARGET ${proj}
PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
set(local_git_repo "../../LocalRepositories/GIT-with-submodules")
set(proj TS1-GIT-no-GIT_SUBMODULES)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DWITH_m1:BOOL=ON
-DWITH_m2:BOOL=ON
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
"SetupLocalGITRepositoryWithSubmodules"
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
set(proj TS1-GIT-empty-GIT_SUBMODULES)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
GIT_SUBMODULES ""
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DWITH_m1:BOOL=ON
-DWITH_m2:BOOL=ON
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
"SetupLocalGITRepositoryWithSubmodules"
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
set(proj TS1-GIT-some-GIT_SUBMODULES)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
GIT_SUBMODULES "m/m1"
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DWITH_m1:BOOL=ON
-DWITH_m2:BOOL=OFF
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
"SetupLocalGITRepositoryWithSubmodules"
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
endif()
set(do_hg_tests 0)

Binary file not shown.