diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2015-01-29 16:52:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-30 15:06:09 (GMT) |
commit | 81221b80e2d74d120bfb61c62e07e3f7f1b9929f (patch) | |
tree | 70dc6782d940c10d36b0d6e98cc6169fbfc02d9a /Source/CPack/cmCPackGenerator.cxx | |
parent | ea7ca139ea4c3c88e432e722c9cfe1dd86a4359f (diff) | |
download | CMake-81221b80e2d74d120bfb61c62e07e3f7f1b9929f.zip CMake-81221b80e2d74d120bfb61c62e07e3f7f1b9929f.tar.gz CMake-81221b80e2d74d120bfb61c62e07e3f7f1b9929f.tar.bz2 |
CPack: Fix packaging of source tarballs with symbolic links
When staging the package installation, if the first file in a directory
happens to be a symbolic link, make sure we create the directory before
trying to create the link.
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index f21fcf6..1c670d2 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -437,6 +437,18 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " << symlinkedIt->second << "--> " << symlinkedIt->first << std::endl); + // make sure directory exists for symlink + std::string destDir = + cmSystemTools::GetFilenamePath(symlinkedIt->second); + if(!destDir.empty() && !cmSystemTools::MakeDirectory(destDir)) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create dir: " + << destDir + << "\nTrying to create symlink: " + << symlinkedIt->second << "--> " + << symlinkedIt->first + << std::endl); + } if (!cmSystemTools::CreateSymlink(symlinkedIt->first, symlinkedIt->second)) { |