Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
8e8f1118
Commit
8e8f1118
authored
Mar 29, 2017
by
Domen Vrankar
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle non-existing symlink creation locations
parent
cc4fbda1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
Help/manual/cmake.1.rst
Help/manual/cmake.1.rst
+3
-0
Source/cmFileCommand.cxx
Source/cmFileCommand.cxx
+3
-0
Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt
Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt
+3
-0
Tests/RunCMake/file/INSTALL-SYMLINK.cmake
Tests/RunCMake/file/INSTALL-SYMLINK.cmake
+13
-0
Tests/RunCMake/file/RunCMakeTest.cmake
Tests/RunCMake/file/RunCMakeTest.cmake
+1
-0
No files found.
Help/manual/cmake.1.rst
View file @
8e8f1118
...
...
@@ -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
-----------------------------------
...
...
Source/cmFileCommand.cxx
View file @
8e8f1118
...
...
@@ -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
;
...
...
Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt
0 → 100644
View file @
8e8f1118
-- Before Installing
-- Installing: .*/Tests/RunCMake/file/INSTALL-SYMLINK-build/dst/current_dir_symlink
-- After Installing
Tests/RunCMake/file/INSTALL-SYMLINK.cmake
0 → 100644
View file @
8e8f1118
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"
)
Tests/RunCMake/file/RunCMakeTest.cmake
View file @
8e8f1118
...
...
@@ -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
()
Brad King
@brad.king
mentioned in commit
2f359787
·
Mar 30, 2017
mentioned in commit
2f359787
mentioned in commit 2f359787f6a5d6da20621fb1a161c8cac49902bc
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment