summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-30 12:57:04 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-03-30 12:57:07 (GMT)
commit2f359787f6a5d6da20621fb1a161c8cac49902bc (patch)
tree3e7765fc6d77e819c1183fc079d3eaeea1eedb88 /Tests
parent7a6ab42f4712adf788156f127aacdad3e1c49cab (diff)
parent8e8f1118b947905e0e881ea3d9cc881f5fdce89d (diff)
downloadCMake-2f359787f6a5d6da20621fb1a161c8cac49902bc.zip
CMake-2f359787f6a5d6da20621fb1a161c8cac49902bc.tar.gz
CMake-2f359787f6a5d6da20621fb1a161c8cac49902bc.tar.bz2
Merge topic 'cmake-file-install-symlink-on-nonexistng-path'
8e8f1118 handle non-existing symlink creation locations Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !642
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/file/INSTALL-SYMLINK-stdout.txt3
-rw-r--r--Tests/RunCMake/file/INSTALL-SYMLINK.cmake13
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake1
3 files changed, 17 insertions, 0 deletions
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()