summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-07 14:47:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-10-07 14:47:23 (GMT)
commit5f9994a6c1abe28522c1fd21783f4d3d60a8f3fb (patch)
treee62de694484f3c1aeecfa60dc16f104577961433 /Tests/RunCMake
parent6d65e8a5ab11336cb614f3d428a8bfd288bb97d5 (diff)
parent569fb1893e6d49677e3724b82e578b568aaa1504 (diff)
downloadCMake-5f9994a6c1abe28522c1fd21783f4d3d60a8f3fb.zip
CMake-5f9994a6c1abe28522c1fd21783f4d3d60a8f3fb.tar.gz
CMake-5f9994a6c1abe28522c1fd21783f4d3d60a8f3fb.tar.bz2
Merge topic 'improve-symlink-error-reporting'
569fb1893e file(INSTALL): Report "Installing:" for a symlink to a directory 1461ae4933 file(INSTALL): Clarify symlink vs dir conflict errors 85f01a1ec2 file(INSTALL): Improve formatting of symlink creation error aba48bd6ac cmSystemTools: Provide quiet link creation methods Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !7706
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt1
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt12
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake11
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake4
5 files changed, 40 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt
new file mode 100644
index 0000000..d082b8a
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at cmake_install.cmake:[0-9]+ \(file\):
+ file INSTALL cannot duplicate symlink
+
+ [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/new/dir
+
+ at
+
+ [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
+
+ because: A directory already exists at that location
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
new file mode 100644
index 0000000..db8ca10
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
@@ -0,0 +1,12 @@
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir/file
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk
+-- Up-to-date: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk/file
+-- Installing: [^
+]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake b/Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake
new file mode 100644
index 0000000..ac7a2cf
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber.cmake
@@ -0,0 +1,11 @@
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/old/dir)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/old/dir/file "")
+file(CREATE_LINK dir ${CMAKE_CURRENT_BINARY_DIR}/old/lnk SYMBOLIC)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/old/dir DESTINATION dest)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/old/lnk DESTINATION dest)
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/new/lnk)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/new/lnk/file "")
+file(CREATE_LINK lnk ${CMAKE_CURRENT_BINARY_DIR}/new/dir SYMBOLIC)
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/new/lnk DESTINATION dest)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/new/dir DESTINATION dest)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 7c12d4a..477ffe0 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -175,6 +175,10 @@ run_install_test(FILES-PERMISSIONS)
run_install_test(TARGETS-RPATH)
run_install_test(InstallRequiredSystemLibraries)
+if(UNIX)
+ run_install_test(DIRECTORY-symlink-clobber)
+endif()
+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
run_cmake(TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle)
run_cmake(TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework)