# add\_externalproject argument explanation

**URL:** <https://discourse.cmake.org/t/add-externalproject-argument-explanation/5888>\
**Category:** Code\
**Created:** [June 17, 2022, 8:44pm UTC](https://discourse.cmake.org/t/add-externalproject-argument-explanation/5888 "2022-06-17T20:44:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrasvestartas](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/eb9ed0/32.png) [@petrasvestartas](https://discourse.cmake.org/u/petrasvestartas)\
**Post date:** [June 17, 2022, 8:44pm UTC](https://discourse.cmake.org/t/add-externalproject-argument-explanation/5888/1 "2022-06-17T20:44:38Z")

</div>

Question is about arguments inside ExternalProject\_Add function.  
What is the difference between:

```auto
1. SOURCE_DIR
2. INSTALL_DIR
3. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH

```

---

<div class="post-metadata">

**Author:** ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Post date:** [June 18, 2022, 11:32am UTC](https://discourse.cmake.org/t/add-externalproject-argument-explanation/5888/2 "2022-06-18T11:32:16Z")

</div>

> [@petrasvestartas](#):
>
> ExternalProject\_Add function.  
> What is the difference between:
> 
> ```auto
> 1. SOURCE_DIR
> 2. INSTALL_DIR
> 
> ```

There is good Dokumentation at [https://cmake.org/cmake/help/latest/variable/CMAKE\_INSTALL\_PREFIX.html](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)

---

<div class="post-metadata">

**Author:** ![petrasvestartas](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/p/eb9ed0/32.png) [@petrasvestartas](https://discourse.cmake.org/u/petrasvestartas)\
**Post date:** [June 19, 2022, 10:45am UTC](https://discourse.cmake.org/t/add-externalproject-argument-explanation/5888/3 "2022-06-19T10:45:44Z")

</div>

Do you know why this argument does nothing to change download directory:  
CMAKE\_ARGS -DCMAKE\_INSTALL\_PREFIX:PATH

Only SOURCE\_DIR makes a change?

---

<div class="post-metadata">

**Author:** ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)\
**Post date:** [June 20, 2022, 5:55am UTC](https://discourse.cmake.org/t/add-externalproject-argument-explanation/5888/4 "2022-06-20T05:55:21Z")

</div>

Yes, only `SOURCE_DIR` sets the directory.  
The `CMAKE_ARGS` is passed to the `cmake` command after the sources have been downloaded.
