diff options
author | Eric NOULARD <eric.noulard@gmail.com> | 2012-05-20 15:28:54 (GMT) |
---|---|---|
committer | Eric NOULARD <eric.noulard@gmail.com> | 2012-05-20 15:28:54 (GMT) |
commit | 4986d525afcddcad6f8610c85cc7d2cf46701ad5 (patch) | |
tree | 070cafea4f5f2b6bd2c26a190288a3634f203616 /Source/CPack/cmCPackGenerator.cxx | |
parent | f90223cafc4be83a1556e2d238e2af596afbd616 (diff) | |
download | CMake-4986d525afcddcad6f8610c85cc7d2cf46701ad5.zip CMake-4986d525afcddcad6f8610c85cc7d2cf46701ad5.tar.gz CMake-4986d525afcddcad6f8610c85cc7d2cf46701ad5.tar.bz2 |
Use CPACK_xxx and CMAKE_xxx in a consistent way.
CMAKE_xxx vars are now used in the CMake-generated cmake_install.cmake
script while CPACK_xxx equivalent vars are used from within CPack.
CPack is responsible for getting/forwarding definitions of
CPACK_xxxx var corresponding to CMAKE_xxxx when invoking
CMake-generated install scripts.
As a consequence:
CMAKE_ABSOLUTE_DESTINATION_FILES
CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION
may be used from outside CPack as well.
e.g.
cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=1 -P cmake_install.cmake
works as expected.
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index ca790c0..87a3b9e 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -854,7 +854,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( // then forward request to cmake_install.cmake script if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION")) { - mf->AddDefinition("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", + mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION", "1"); } // If current CPack generator does support @@ -864,11 +864,19 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( if (!SupportsAbsoluteDestination() || this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION")) { - mf->AddDefinition("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", + mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", "1"); } // do installation int res = mf->ReadListFile(0, installFile.c_str()); + // forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES + // to CPack (may be used by generators like CPack RPM or DEB) + // in order to transparently handle ABSOLUTE PATH + if (mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")) + { + mf->AddDefinition("CPACK_ABSOLUTE_DESTINATION_FILES", + mf->GetDefinition("CMAKE_ABSOLUTE_DESTINATION_FILES")); + } // Now rebuild the list of files after installation // of the current component (if we are in component install) |