# ExternalProject that depends on another target for SOURCE\_DIR

**URL:** <https://discourse.cmake.org/t/externalproject-that-depends-on-another-target-for-source-dir/9979>\
**Category:** Code\
**Created:** [January 31, 2024, 9:04pm UTC](https://discourse.cmake.org/t/externalproject-that-depends-on-another-target-for-source-dir/9979 "2024-01-31T21:04:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kentzo](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kentzo/32/4122_2.png) [@Kentzo](https://discourse.cmake.org/u/Kentzo)\
**Post date:** [January 31, 2024, 9:04pm UTC](https://discourse.cmake.org/t/externalproject-that-depends-on-another-target-for-source-dir/9979/1 "2024-01-31T21:04:21Z")

</div>

I’m trying to define an external project that depends on another target to prepare its source directory:

```cmake
ExternalProject_Add(Dependency ...)
ExternalProject_Get_Property(Dependency INSTALL_DIR)
set(target_source_dir "${INSTALL_DIR}")

ExternalProject_Add(Target
    DEPENDS Dependency
    SOURCE_DIR "${target_source_dir}"
    BUILD_IN_SOURCE TRUE
    ...
)

```

However, CMake fails with the following error:

```auto
  No download info given for '...' and its source directory:
   /some/directory
  is not an existing non-empty directory. Please specify one of:

```

where `/some/directory` exists but is empty at the time of configuration.

Should I put an empty file in `/some/directory` to satisfy the check?

---

<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:** [February 4, 2024, 1:57pm UTC](https://discourse.cmake.org/t/externalproject-that-depends-on-another-target-for-source-dir/9979/2 "2024-02-04T13:57:59Z")

</div>

I think you need do add a dependency from the download step as that is typically assumed to have no dependencies.

Cc: @craig.scott
