From b1c2cb0436a59845085dd7f5309225ce3093921b Mon Sep 17 00:00:00 2001 From: Michael Durso Jr Date: Fri, 6 May 2022 19:40:33 -0400 Subject: ExternalProject: Make SVN interactive with USES_TERMINAL_{DOWNLOAD,UPDATE} ExternalProject_Add() supports USES_TERMINAL_* flags to enable user input for different steps. The Subversion download options ignored these flags when checking out or updated a Subversion repo. Fixes: #23348 --- Copyright.txt | 1 + Modules/ExternalProject.cmake | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Copyright.txt b/Copyright.txt index 4b6a7f5..2cf1769 100644 --- a/Copyright.txt +++ b/Copyright.txt @@ -78,6 +78,7 @@ The following individuals and institutions are among the Contributors: * Michael Hirsch, Ph.D. * Michael Stürmer * Miguel A. Figueroa-Villanueva +* Mike Durso * Mike Jackson * Mike McQuaid * Nicolas Bock diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index 5c37be2..707de88 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2530,6 +2530,12 @@ function(_ep_add_download_command name) get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME) get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD) get_property(svn_trust_cert TARGET ${name} PROPERTY _EP_SVN_TRUST_CERT) + get_property(uses_terminal TARGET ${name} PROPERTY _EP_USES_TERMINAL_DOWNLOAD) + if(uses_terminal) + set(svn_interactive_args "") + else() + set(svn_interactive_args "--non-interactive") + endif() get_filename_component(src_name "${source_dir}" NAME) get_filename_component(work_dir "${source_dir}" PATH) @@ -2545,7 +2551,8 @@ function(_ep_add_download_command name) set(svn_trust_cert_args --trust-server-cert) endif() set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} - --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name}) + ${svn_interactive_args} ${svn_trust_cert_args} ${svn_user_pw_args} + ${src_name}) elseif(git_repository) set(method git) @@ -2934,6 +2941,12 @@ function(_ep_add_update_command name) get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME) get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD) get_property(svn_trust_cert TARGET ${name} PROPERTY _EP_SVN_TRUST_CERT) + get_property(uses_terminal TARGET ${name} PROPERTY _EP_USES_TERMINAL_UPDATE) + if(uses_terminal) + set(svn_interactive_args "") + else() + set(svn_interactive_args "--non-interactive") + endif() set(svn_user_pw_args "") if(DEFINED svn_username) set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") @@ -2945,7 +2958,7 @@ function(_ep_add_update_command name) set(svn_trust_cert_args --trust-server-cert) endif() set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision} - --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args}) + ${svn_interactive_args} ${svn_trust_cert_args} ${svn_user_pw_args}) set(always 1) elseif(git_repository) # FetchContent gives us these directly, so don't try to recompute them -- cgit v0.12