Merge topic 'fix-cpack-symlink-create-dir'

55e68bc9 Merge branch 'backport-fix-cpack-symlink-create-dir' into fix-cpack-symlink-create-dir
4dc5acee CPack: Fix packaging of source tarballs with symbolic links
81221b80 CPack: Fix packaging of source tarballs with symbolic links
This commit is contained in:
Brad King 2015-01-30 10:23:07 -05:00 committed by CMake Topic Stage
commit db4b9fe256
1 changed files with 12 additions and 0 deletions

View File

@ -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))
{