# Specify \<lib\>-prefix folder destination

**URL:** <https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449>\
**Category:** Code\
**Created:** [January 1, 2021, 5:08am UTC](https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449 "2021-01-01T05:08:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerim](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/6f9a4e/32.png) [@kerim](https://discourse.cmake.org/u/kerim)\
**Post date:** [January 1, 2021, 5:08am UTC](https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449/1 "2021-01-01T05:08:33Z")

</div>

Happy New Year! Work less earn much 😃

When I build external project using `ExternalProject_Add` usually I can see three folders:

```auto
<lib> (source folder)
<lib>-build (build folder)
<lib>-install (install folder)
<lib>-prefix (prefix??? folder)

```

For example for hdf5 lib I have:

```auto
HDF5 (source folder)
HDF5-build (build folder)
HDF5-install (install folder)
HDF5-prefix (prefix??? folder)

```

What parameter controlls where `HDF5-prefix` will be located?

Usually I have:

```cmake
ExternalProject_Add(${proj}
  SOURCE_DIR ${EP_SOURCE_DIR}
  BINARY_DIR ${EP_BINARY_DIR}
  INSTALL_DIR ${EP_INSTALL_DIR}
...
)

```

these specify only src, build and install dirs. How to specify `<lib>-prefix` dir?

---

<div class="post-metadata">

**Author:** ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)\
**Post date:** [January 1, 2021, 11:34am UTC](https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449/2 "2021-01-01T11:34:14Z")

</div>

Quoting [https://cmake.org/cmake/help/latest/module/ExternalProject.html:](https://cmake.org/cmake/help/latest/module/ExternalProject.html:)

> `PREFIX <dir>`
> 
> Root directory for the external project. Unless otherwise noted below, all other directories associated with the external project will be created under here.

and

> If no `PREFIX` , `EP_PREFIX` , or `EP_BASE` is specified, then the default is to set `PREFIX` to `<name>-prefix` .

---

<div class="post-metadata">

**Author:** ![kerim](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/6f9a4e/32.png) [@kerim](https://discourse.cmake.org/u/kerim)\
**Post date:** [January 1, 2021, 1:14pm UTC](https://discourse.cmake.org/t/specify-lib-prefix-folder-destination/2449/3 "2021-01-01T13:14:18Z")

</div>

thank you!
