Commit 37662ea4 authored by Brad King's avatar Brad King
Browse files

Merge branch 'backport-fix-cpack-symlink-create-dir' into release-3.1

parents 048fb8e3 4dc5acee
......@@ -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).c_str(),
(symlinkedIt->second).c_str()))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment