File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,18 @@ function(external_dependency)
7272 set (src_dir ${bin_dir} _src)
7373 if (NOT IS_DIRECTORY ${src_dir} )
7474 if (ARG_GIT_TAG)
75- set (clone_opts --branch ${ARG_GIT_TAG} -c advice.detachedHead=false )
75+ set (clone_opts --branch ${ARG_GIT_TAG} -c advice.detachedHead=false )
76+ endif ()
77+ if (NOT GIT_EXECUTABLE)
78+ find_package (Git REQUIRED)
79+ endif ()
80+ execute_process (COMMAND ${GIT_EXECUTABLE} clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir}
81+ RESULT_VARIABLE clone_failed
82+ ERROR_VARIABLE clone_error
83+ )
84+ if (clone_failed)
85+ message (FATAL_ERROR "Failed to clone sources for dependency ${ARGV0} .\n ${clone_error} " )
7686 endif ()
77- execute_process (COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir} )
7887 endif ()
7988 add_subdirectory (${src_dir} ${bin_dir} ${subdir_opts} )
8089 else ()
You can’t perform that action at this time.
0 commit comments