From 6e1282f840fe50707c928079465ab315f07a59fe Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 22 Oct 2010 16:09:07 -0400 Subject: [PATCH] ExternalProject: No svn --username if empty (#11173) Nor --password. But please do if non-empty. Thank you. --- Modules/ExternalProject.cmake | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index d76796f44..f3c907fc3 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -985,8 +985,15 @@ function(_ep_add_download_command name) get_filename_component(src_name "${source_dir}" NAME) get_filename_component(work_dir "${source_dir}" PATH) set(comment "Performing download step (SVN checkout) for '${name}'") + set(svn_user_pw_args "") + if(svn_username) + set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") + endif() + if(svn_password) + set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}") + endif() set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} - --username=${svn_username} --password=${svn_password} ${src_name}) + ${svn_user_pw_args} ${src_name}) list(APPEND depends ${stamp_dir}/${name}-svninfo.txt) elseif(git_repository) find_package(Git) @@ -1125,8 +1132,15 @@ function(_ep_add_update_command name) get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION) get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME) get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD) + set(svn_user_pw_args "") + if(svn_username) + set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}") + endif() + if(svn_password) + set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}") + endif() set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision} - --username=${svn_username} --password=${svn_password}) + ${svn_user_pw_args}) set(always 1) elseif(git_repository) if(NOT GIT_EXECUTABLE)