mirror of
https://github.com/triqs/dft_tools
synced 2024-09-12 05:38:31 +02:00
[cmake] Use FindGit.cmake in external_dependency.cmake, Improve error message on clone failure
This commit is contained in:
parent
14d30a1a14
commit
5dbd12f165
11
deps/external_dependency.cmake
vendored
11
deps/external_dependency.cmake
vendored
@ -74,7 +74,16 @@ function(external_dependency)
|
||||
if(ARG_GIT_TAG)
|
||||
set(clone_opts --branch ${ARG_GIT_TAG} -c advice.detachedHead=false)
|
||||
endif()
|
||||
execute_process(COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir})
|
||||
if(NOT GIT_EXECUTABLE)
|
||||
find_package(Git REQUIRED)
|
||||
endif()
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir}
|
||||
RESULT_VARIABLE clone_failed
|
||||
ERROR_VARIABLE clone_error
|
||||
)
|
||||
if(clone_failed)
|
||||
message(FATAL_ERROR "Failed to clone sources for dependency ${ARGV0}.\n ${clone_error}")
|
||||
endif()
|
||||
endif()
|
||||
add_subdirectory(${src_dir} ${bin_dir} ${subdir_opts})
|
||||
else()
|
||||
|
Loading…
Reference in New Issue
Block a user