[Cmake-commits] CMake branch, next, updated. v3.8.0-rc3-615-g6543b1b
Kitware Robot
kwrobot at kitware.com
Wed Mar 29 02:25:07 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 6543b1b9b1109f14292a3a63546f44ab22e0ed48 (commit)
via 8e8f1118b947905e0e881ea3d9cc881f5fdce89d (commit)
from ae2232a4e86e21e52f73c709feb729bd94271dca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6543b1b9b1109f14292a3a63546f44ab22e0ed48
commit 6543b1b9b1109f14292a3a63546f44ab22e0ed48
Merge: ae2232a 8e8f111
Author: Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Wed Mar 29 06:21:41 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Mar 29 02:22:08 2017 -0400
Stage topic 'cmake-file-install-symlink-on-nonexistng-path'
Topic-id: 23338
Topic-url: https://gitlab.kitware.com/cmake/cmake/merge_requests/642
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8e8f1118b947905e0e881ea3d9cc881f5fdce89d
commit 8e8f1118b947905e0e881ea3d9cc881f5fdce89d
Author: Domen Vrankar <domen.vrankar at gmail.com>
AuthorDate: Wed Mar 29 00:22:52 2017 +0200
Commit: Domen Vrankar <domen.vrankar at gmail.com>
CommitDate: Wed Mar 29 00:22:52 2017 +0200
handle non-existing symlink creation locations
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index 063aea1..a11e2f9 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -315,6 +315,9 @@ The following ``cmake -E`` commands are available only on UNIX:
``create_symlink <old> <new>``
Create a symbolic link ``<new>`` naming ``<old>``.
+.. note::
+ Path to where ``<new>`` symbolic link will be created has to exist beforehand.
+
Windows-specific Command-Line Tools
-----------------------------------
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;
diff --git a/Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt b/Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt
new file mode 100644
index 0000000..9fb8e10
--- /dev/null
+++ b/Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt
@@ -0,0 +1,3 @@
+-- Before Installing
+-- Installing: .*/Tests/RunCMake/file/INSTALL-SYMLINK-build/dst/current_dir_symlink
+-- After Installing
diff --git a/Tests/RunCMake/file/INSTALL-SYMLINK.cmake b/Tests/RunCMake/file/INSTALL-SYMLINK.cmake
new file mode 100644
index 0000000..5a4284a
--- /dev/null
+++ b/Tests/RunCMake/file/INSTALL-SYMLINK.cmake
@@ -0,0 +1,13 @@
+set(src "${CMAKE_CURRENT_BINARY_DIR}/src")
+set(dst "${CMAKE_CURRENT_BINARY_DIR}/dst")
+file(REMOVE RECURSE "${src}")
+file(REMOVE RECURSE "${dst}")
+
+file(MAKE_DIRECTORY "${src}")
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E create_symlink source "${src}/current_dir_symlink")
+
+message(STATUS "Before Installing")
+file(INSTALL FILES "${src}/current_dir_symlink"
+ DESTINATION ${dst} TYPE DIRECTORY)
+message(STATUS "After Installing")
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 3f3c0da..63cbdd9 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -36,4 +36,5 @@ run_cmake(GLOB-noexp-LIST_DIRECTORIES)
if(NOT WIN32 OR CYGWIN)
run_cmake(GLOB_RECURSE-cyclic-recursion)
+ run_cmake(INSTALL-SYMLINK)
endif()
-----------------------------------------------------------------------
Summary of changes:
Help/manual/cmake.1.rst | 3 +++
Source/cmFileCommand.cxx | 3 +++
Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt | 3 +++
Tests/RunCMake/file/INSTALL-SYMLINK.cmake | 13 +++++++++++++
Tests/RunCMake/file/RunCMakeTest.cmake | 1 +
5 files changed, 23 insertions(+)
create mode 100644 Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt
create mode 100644 Tests/RunCMake/file/INSTALL-SYMLINK.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list