summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorDomen Vrankar <domen.vrankar@gmail.com>2017-03-28 22:22:52 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2017-03-28 22:22:52 (GMT)
commit8e8f1118b947905e0e881ea3d9cc881f5fdce89d (patch)
tree8e5bbf4fe087a2a5b4e31d508c1bdae5e95185df /Source/cmFileCommand.cxx
parentcc4fbda1a9fffd8927de870643f167f066b26bcd (diff)
downloadCMake-8e8f1118b947905e0e881ea3d9cc881f5fdce89d.zip
CMake-8e8f1118b947905e0e881ea3d9cc881f5fdce89d.tar.gz
CMake-8e8f1118b947905e0e881ea3d9cc881f5fdce89d.tar.bz2
handle non-existing symlink creation locations
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 97292f9..7207d34 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1486,6 +1486,9 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
// Remove the destination file so we can always create the symlink.
cmSystemTools::RemoveFile(toFile);
+ // Create destination directory if it doesn't exist
+ cmSystemTools::MakeDirectory(cmSystemTools::GetFilenamePath(toFile));
+
// Create the symlink.
if (!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) {
std::ostringstream e;