ExternalProject_Add does not respect USES_TERMINAL_* flags.

The latest CMake docs for ExternalProject_Add() describe how to use the directive to download external dependencies through version control systems like Git, Subversion, and others.

The docs also mention a section called “Terminal Access Options” (since 3.4) that grant various steps access to the terminal. However, for at least Subversion in the download step, CMake hard codes “–non-interactive” to the Subversion checkout command

The easiest way to test this is to:

ExternalProject_Add(
    myextdep
    USES_TERMINAL_DOWNLOAD true
    SVN_REPOSITORY https://example.com/path/to/username-password/protected/repo
)

One workaround would have been to use the SVN_USERNAME and SVN_PASSWORD options to ExternalProject_Add(). However that does not work when the username/password is not predictable, nor in situations where we cannot put username/passwords into cmake scripts, or piped in with environment variables, etc. The desired behaviour I would have expected would pause the Subversion checkout process with a prompt asking for the Subversion username/password as if the user ran the “svn co …” command directly. This is why the USES_TERMINAL_* options exist, right?

I considered adding submitting a patch rather than raise a discussion here, but I do not believe fixing Subversion in the Download step is the complete solution. I am not sure how wide this bug effects. Is it all VCS types? Is it all USES_TERMINAL_* flags?

I’m hoping someone with more historical knowledge of the ExternalProject_Add functionality can chime in. Is this a bug? Or am I using ExternalProject_Add() + USES_TERMINAL_* incorrectly?

Thanks in advacned!

Yes that does look like an oversight. It would be appreciated if you could open an issue in the bug tracker for this.

https://gitlab.kitware.com/cmake/cmake/-/issues/new

@craig.scott yep, I sure can. I created issue #23348.