# Ask FetchContent\_Declare to dowload to ${project\_SOURCE\_DIR}/\<subdir\>

**URL:** <https://discourse.cmake.org/t/ask-fetchcontent-declare-to-dowload-to-project-source-dir-subdir/5743>\
**Category:** Code\
**Created:** [May 26, 2022, 10:30pm UTC](https://discourse.cmake.org/t/ask-fetchcontent-declare-to-dowload-to-project-source-dir-subdir/5743 "2022-05-26T22:30:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rturrado](https://discourse.cmake.org/user_avatar/discourse.cmake.org/rturrado/32/3499_2.png) [@rturrado](https://discourse.cmake.org/u/rturrado)\
**Post date:** [May 26, 2022, 10:30pm UTC](https://discourse.cmake.org/t/ask-fetchcontent-declare-to-dowload-to-project-source-dir-subdir/5743/1 "2022-05-26T22:30:27Z")

</div>

I’m using FetchContent to get [CryptoPP](https://github.com/weidai11/cryptopp.git) into my project.

The point is that `${cryptopp_SOURCE_DIR}` already contains `.h` and `.cpp` files.

I would like to tell FetchContent to download the package to a `${cryptopp_SOURCE_DIR}/cryptopp` folder, so that, in my code, I could `#include "cryptopp/whatever.h"`.

Is that possible?

---

<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:** [May 27, 2022, 11:22pm UTC](https://discourse.cmake.org/t/ask-fetchcontent-declare-to-dowload-to-project-source-dir-subdir/5743/2 "2022-05-27T23:22:20Z")

</div>

`${cryptopp_SOURCE_DIR}` is defined as the place the source is downloaded to, so trying to make it download to `${cryptopp_SOURCE_DIR}/cryptopp` isn’t the right thing to be trying to do. You can define the actual directory by specifying `SOURCE_DIR` as one of the `FetchContent_Declare()` arguments. Then you take on the full responsibility of where to put the source dir too (i.e. the full path), not just the name of the leaf directory.
