# ExternalProject\_Add does not respect USES\_TERMINAL\_\* flags.

**URL:** <https://discourse.cmake.org/t/externalproject-add-does-not-respect-uses-terminal-flags/5254>\
**Category:** Code\
**Created:** [March 20, 2022, 1:05pm UTC](https://discourse.cmake.org/t/externalproject-add-does-not-respect-uses-terminal-flags/5254 "2022-03-20T13:05:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbprogrammer](https://discourse.cmake.org/user_avatar/discourse.cmake.org/rbprogrammer/32/2276_2.png) [@rbprogrammer](https://discourse.cmake.org/u/rbprogrammer)\
**Post date:** [March 20, 2022, 1:05pm UTC](https://discourse.cmake.org/t/externalproject-add-does-not-respect-uses-terminal-flags/5254/1 "2022-03-20T13:05:09Z")

</div>

The latest CMake docs for [ExternalProject\_Add()](https://cmake.org/cmake/help/latest/module/ExternalProject.html) 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

- [https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/ExternalProject.cmake#L2534](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/ExternalProject.cmake#L2534)
- `set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision} --non-interactive ${svn_trust_cert_args} ${svn_user_pw_args} ${src_name})`

The easiest way to test this is to:

```auto
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!

---

<div class="post-metadata">

**Author:** ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Post date:** [March 20, 2022, 10:30pm UTC](https://discourse.cmake.org/t/externalproject-add-does-not-respect-uses-terminal-flags/5254/2 "2022-03-20T22:30:18Z")

</div>

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](https://gitlab.kitware.com/cmake/cmake/-/issues/new)

---

<div class="post-metadata">

**Author:** ![rbprogrammer](https://discourse.cmake.org/user_avatar/discourse.cmake.org/rbprogrammer/32/2276_2.png) [@rbprogrammer](https://discourse.cmake.org/u/rbprogrammer)\
**Post date:** [March 21, 2022, 11:43am UTC](https://discourse.cmake.org/t/externalproject-add-does-not-respect-uses-terminal-flags/5254/3 "2022-03-21T11:43:06Z")

</div>

@craig.scott yep, I sure can. I created [issue #23348](https://gitlab.kitware.com/cmake/cmake/-/issues/23348).
