title: cpack and install(CODE ...) - CPACK_PACKAGING_INSTALL_PREFIX vs CMAKE_INSTALL_PREFIX
body: <p>as a "post-install hook" I need to execute an install command like</p>
  
  <pre><code>install(CODE "execute_process(COMMAND some_command ${CMAKE_INSTALL_PREFIX}/some_folder"))
  </code></pre>
  
  <p>which creates a file in <code>some_folder</code> based on the files which were previously installed into <code>some_folder</code> (it compiles an index/cache of those files).</p>
  
  <p>This works fine for the install target, however as soon as using cpack <code>${CMAKE_INSTALL_PREFIX}</code> is not the correct location anymore.</p>
  
  <p>Is there a variable like ${CMAKE_CURRENT_INSTALL_PREFIX} that always points towards the current installation directory, regardless of wether the default install target or cpack is used and can be used for this purpose?</p>
  
  <p>The only alternative I see is to try to execute the command at an earlier stage on the original files, create a temporary file and install the temporary file. Unfortunately this is much more error prone, as <code>some_command</code> should be run on the "final" files after installation (in order to create a valid cache)</p>