# help passing passing empty parameter ("") indirectly to \`ExternalProject\_Add\`

**URL:** https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307
**Category:** Usage
**Created:** [December 6, 2020, 5:31pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307 "2020-12-06T17:31:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![daroxs95](https://discourse.cmake.org/user_avatar/discourse.cmake.org/daroxs95/32/999_2.png) [@daroxs95](https://discourse.cmake.org/u/daroxs95)
#### Post date: [December 6, 2020, 5:31pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307/1 "2020-12-06T17:31:35Z")

</div>

this code is not working currently(not deactivating the download step), if provided non empty string, it does treat it as the download command

```auto
set(FRESH_DOWNLOAD off CACHE BOOL "download a fresh copy of all dependencies")

include(ExternalProject)
if (NOT FRESH_DOWNLOAD)
    # Define the variable to disable DOWNLOAD step
    set(civ_DOWNLOAD DOWNLOAD_COMMAND "")
else()
    # Define an empty variable.
    # This actually can be omitted since absent variable is treated as empty.
    set(civ_DOWNLOAD)
endif()

ExternalProject_Add(civ
  SOURCE_DIR ${PROJECT_SOURCE_DIR}/test
  BUILD_COMMAND ${MAKE_EXE}
  BINARY_DIR "./bin"
  INSTALL_COMMAND ""
  GIT_REPOSITORY "https://github.com/test/test"
  GIT_TAG "v1.0"
  ${civ_DOWNLOAD} # IMPORTANT: Do not use double quotes here.
  CMAKE_ARGS
    "-DTuberosumTools_DIR=${TUBEROSUMTOOLS_DIR}"
)

```

original question here

> <https://stackoverflow.com/questions/65164548/is-there-an-easy-way-of-skip-download-step-if-folder-exists-in-cmake-externalpr/65166546#65166546>

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 6, 2020, 6:37pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307/2 "2020-12-06T18:37:02Z")

</div>

Passing empty strings is tough. For simplicity, I would recommend using a command of something like `true` (for Unix) or a similar command on Windows. It has a similar effect, but you don’t have to fight argument quoting rules.

---

<div class="post-metadata">

### Author: ![daroxs95](https://discourse.cmake.org/user_avatar/discourse.cmake.org/daroxs95/32/999_2.png) [@daroxs95](https://discourse.cmake.org/u/daroxs95)
#### Post date: [December 7, 2020, 4:45pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307/3 "2020-12-07T16:45:54Z")

</div>

Thanks, that is my currently solution, except i need the code to be crossplatform, so instead of `"true"` i am trying to use something like `"cd ."`, but i am really new to cmake, and not sure how to write it cause that way is not executed exactly like that, my guess is that cmake adds arguments. I am also new to `bash` and windows `cmd` so, no idea what alternative could use.

EDIT: i am using `dir` right now, not the best aproach though.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 7, 2020, 5:15pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307/4 "2020-12-07T17:15:45Z")

</div>

It might be easier to make the `GIT_` information conditional. That way, ExternalProject won’t know how to downoad it anyways.

---

<div class="post-metadata">

### Author: ![daroxs95](https://discourse.cmake.org/user_avatar/discourse.cmake.org/daroxs95/32/999_2.png) [@daroxs95](https://discourse.cmake.org/u/daroxs95)
#### Post date: [December 7, 2020, 11:41pm UTC](https://discourse.cmake.org/t/help-passing-passing-empty-parameter-indirectly-to-externalproject-add/2307/5 "2020-12-07T23:41:42Z")

</div>

You mean like the repo name? Never think in that, i will try it, thanks again.
