summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CPack/cmCPackGenerator.cxx12
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))
{