# how to get the temporary install directory used by CPackDeb ?

**URL:** https://discourse.cmake.org/t/how-to-get-the-temporary-install-directory-used-by-cpackdeb/692
**Category:** Usage
**Tags:** os:linux
**Created:** [February 24, 2020, 3:51pm UTC](https://discourse.cmake.org/t/how-to-get-the-temporary-install-directory-used-by-cpackdeb/692 "2020-02-24T15:51:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ubiquite](https://discourse.cmake.org/user_avatar/discourse.cmake.org/ubiquite/32/675_2.png) [@Ubiquite](https://discourse.cmake.org/u/Ubiquite)
#### Post date: [February 24, 2020, 3:51pm UTC](https://discourse.cmake.org/t/how-to-get-the-temporary-install-directory-used-by-cpackdeb/692/1 "2020-02-24T15:51:33Z")

</div>

Hi all

I need to run a command with install(CODE “…”) when generating my .deb with make package.  
For this command I need to know the path of the temporary install made by cpack.  
It seems to be in \_CPack\_Packages/Linux/DEB/ but is there a variable to read it ?  
I though CMAKE\_INSTALL\_PREFIX would be modified (with \ before ${CMAKE\_INSTALL\_PREFIX }) but with or without CPACK\_SET\_DESTDIR on the variable is always the finale destination folder (/opt/something).

Is there a way inside install(CODE “…”) to get the temporary cpack install folder ?

Thanks

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [February 24, 2020, 4:15pm UTC](https://discourse.cmake.org/t/how-to-get-the-temporary-install-directory-used-by-cpackdeb/692/2 "2020-02-24T16:15:06Z")

</div>

`$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}`
