summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-30 15:23:07 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-01-30 15:23:07 (GMT)
commitdb4b9fe25673c252a93c15040909d328dc83dde9 (patch)
tree6037c8f33489218a7dfdeb72536eb39b84dfc88f
parent85fe9400cd68805501d2cd98cf7375c8845492f6 (diff)
parent55e68bc99e62430ba2a94410992effd87bea7e33 (diff)
downloadCMake-db4b9fe25673c252a93c15040909d328dc83dde9.zip
CMake-db4b9fe25673c252a93c15040909d328dc83dde9.tar.gz
CMake-db4b9fe25673c252a93c15040909d328dc83dde9.tar.bz2
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
-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))
{