# How to specify CMake cache variable CMAKE INSTALL PREFIX in CMakeLists.txt

**URL:** https://discourse.itk.org/t/how-to-specify-cmake-cache-variable-cmake-install-prefix-in-cmakelists-txt/1135
**Category:** Engineering
**Tags:** cmake
**Created:** [July 20, 2018, 1:51pm UTC](https://discourse.itk.org/t/how-to-specify-cmake-cache-variable-cmake-install-prefix-in-cmakelists-txt/1135 "2018-07-20T13:51:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Neerajan\_S](https://discourse.itk.org/letter_avatar_proxy/v4/letter/n/d78d45/32.png) [@Neerajan\_S](https://discourse.itk.org/u/Neerajan_S)
#### Post date: [July 20, 2018, 1:51pm UTC](https://discourse.itk.org/t/how-to-specify-cmake-cache-variable-cmake-install-prefix-in-cmakelists-txt/1135/1 "2018-07-20T13:51:45Z")

</div>

How to specify CMake cache variable CMAKE INSTALL PREFIX so that I dont have to specify the ITK build directory whenever I am building a new ITK source directory

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [July 20, 2018, 2:12pm UTC](https://discourse.itk.org/t/how-to-specify-cmake-cache-variable-cmake-install-prefix-in-cmakelists-txt/1135/2 "2018-07-20T14:12:38Z")

</div>

Hi @Neerajan_S,

If you are using `cmake` from the command line, specify CMake cache variables with the `-D` flag, e.g.

```auto
cmake -DCMAKE_INSTALL_PREFIX=$HOME/work/install-prefix ~/work/src/ITK

```

Hope this helps,  
Matt
