# what is preset's installDir

**URL:** https://discourse.cmake.org/t/what-is-presets-installdir/4907
**Category:** Usage
**Created:** [January 25, 2022, 4:05pm UTC](https://discourse.cmake.org/t/what-is-presets-installdir/4907 "2022-01-25T16:05:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![redbaron](https://discourse.cmake.org/user_avatar/discourse.cmake.org/redbaron/32/2129_2.png) [@redbaron](https://discourse.cmake.org/u/redbaron)
#### Post date: [January 25, 2022, 4:05pm UTC](https://discourse.cmake.org/t/what-is-presets-installdir/4907/1 "2022-01-25T16:05:08Z")

</div>

I am switching to presets and can’t figure out how to use `installDir`. Is it the same or different than `CMAKE_INSTALL_PREFIX`? I have `"installDir": "out/${presetName}"` , but it still tries to install to the default CMAKE\_INSTALL\_PREFIX on my platform .

How to use `installDir` correctly?

---

<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 25, 2022, 7:35pm UTC](https://discourse.cmake.org/t/what-is-presets-installdir/4907/2 "2022-01-25T19:35:27Z")

</div>

Which `version` are you specifying in your preset file?

From [https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset)

> This is allowed in preset files specifying version 3 or above.

---

<div class="post-metadata">

### Author: ![redbaron](https://discourse.cmake.org/user_avatar/discourse.cmake.org/redbaron/32/2129_2.png) [@redbaron](https://discourse.cmake.org/u/redbaron)
#### Post date: [January 25, 2022, 7:37pm UTC](https://discourse.cmake.org/t/what-is-presets-installdir/4907/3 "2022-01-25T19:37:01Z")

</div>

I am using preset version 3, my CMake is 3.22.1

---

<div class="post-metadata">

### Author: ![redbaron](https://discourse.cmake.org/user_avatar/discourse.cmake.org/redbaron/32/2129_2.png) [@redbaron](https://discourse.cmake.org/u/redbaron)
#### Post date: [February 2, 2022, 2:58pm UTC](https://discourse.cmake.org/t/what-is-presets-installdir/4907/4 "2022-02-02T14:58:26Z")

</div>

@McMartin , it looks like presets are completely ignored when invoking `cmake --install`. How `installDir` option in the preset is supposed to work?

---

<div class="post-metadata">

### Author: ![redbaron](https://discourse.cmake.org/user_avatar/discourse.cmake.org/redbaron/32/2129_2.png) [@redbaron](https://discourse.cmake.org/u/redbaron)
#### Post date: [February 2, 2022, 3:30pm UTC](https://discourse.cmake.org/t/what-is-presets-installdir/4907/5 "2022-02-02T15:30:31Z")

</div>

OMG, I made it work. It wasn’t very not intuitive, cmake-presets doc doesn’t mention any of it.

For those who’ll come here in the future, trick is to run both configure AND build from the source dir, unlike other CMake workflows.

1. First configure: `cmake -S . --preset xxx`
2. Then install **without changing directory** : `cmake --build --preset xxx --target install`
