diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2015-03-26 04:36:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-03-30 13:22:14 (GMT) |
commit | e3f84fc504e96d1bdbc9c70434135903c449bdd1 (patch) | |
tree | d84713c563e0e876d6097d5b2c09a9d9429b7718 /Source/CPack/cmCPackArchiveGenerator.cxx | |
parent | 51b4321e5fdf9f7cbc54881037a45a474883ef47 (diff) | |
download | CMake-e3f84fc504e96d1bdbc9c70434135903c449bdd1.zip CMake-e3f84fc504e96d1bdbc9c70434135903c449bdd1.tar.gz CMake-e3f84fc504e96d1bdbc9c70434135903c449bdd1.tar.bz2 |
cpack: Fix CPACK_PACKAGING_INSTALL_PREFIX handling for archives (#14677)
Fix the case when the archive generator is used to package components
with an install prefix.
Diffstat (limited to 'Source/CPack/cmCPackArchiveGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackArchiveGenerator.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index e2437b5..05b5cd9 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -63,6 +63,14 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive, filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME"); filePrefix += "/"; } + const char* installPrefix = + this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX"); + if(installPrefix && installPrefix[0] == '/' && installPrefix[1] != 0) + { + // add to file prefix and remove the leading '/' + filePrefix += installPrefix+1; + filePrefix += "/"; + } std::vector<std::string>::const_iterator fileIt; for (fileIt = component->Files.begin(); fileIt != component->Files.end(); ++fileIt ) |