title: CMake-CPack Package Installation Path Nightmare
body: <p>I've been frustrated by the the CMake-CPack for almost one week.</p>
  
  <p>The bad thing is the CMake-CPack online documentation does not document this part well.</p>
  
  <p>After googling, I found this variables to use:</p>
  
  <pre><code>CPACK_PACKAGING_PREFIX          # NOT documented
  CMAKE_INSTALL_PREFIX            # Documented, but the behavior seems weird
  CPACK_INSTALL_PREFIX            # NOT documented
  CPACK_PACKAGE_INSTALL_DIRECTORY # Documented, but this variable does NOT work as the online document described
  CPACK_PACKAGING_INSTALL_PREFIX  # NOT documented
  </code></pre>
  
  <p>What I am trying to do is: package a Debian package using <code>fakeroot make package</code>, when the package is installed by <code>sudo dpkg -i MyProgramPackageName</code>, install it to <code>/usr/local</code>, with a subdirectory <code>MyProgramPackageName</code>.  That is, all files should be installed under <code>/usr/local/MyProgramPackageName-V.1.2.3</code>.</p>
  
  <p>I've been trying (CMake 2.8.3 and CMake 2.8.5) to tune these variables.  I tried so many combinations, but failed.</p>
  
  <p>The only way succeeded is:</p>
  
  <pre><code>Set(CPACK_PACKAGING_INSTALL_PREFIX /usr/local/MyProgramPackageName-V.1.2.3)
  </code></pre>
  
  <p>But this variable is NOT even documented, and the behavior cannot be guaranteed.  If you are confused with my question, please advise me when to use <code>CPACK_PACKAGE_INSTALL_DIRECTORY</code>?  because the documentation description about this variable is really attractive, and it is really what I want, but I just could not make it working.</p>
  
  <p>Please advise me.</p>
  
  <p>Peter</p>