diff options
author | Brad King <brad.king@kitware.com> | 2021-05-10 14:10:58 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-05-10 14:11:04 (GMT) |
commit | 3dd38ac36d49c4eea319b9813bbd1f66a7b0fb29 (patch) | |
tree | b5113f2c0286b0aa268a7f0a9f7291b63297b1e3 /Tests | |
parent | 74d35f569316fcd09e1604ac87e53bfb16367a8d (diff) | |
parent | d71a7cc19d6e03f89581efdaa8d63db216184d40 (diff) | |
download | CMake-3dd38ac36d49c4eea319b9813bbd1f66a7b0fb29.zip CMake-3dd38ac36d49c4eea319b9813bbd1f66a7b0fb29.tar.gz CMake-3dd38ac36d49c4eea319b9813bbd1f66a7b0fb29.tar.bz2 |
Merge topic 'install-symlink-to-directory'
d71a7cc19d install(FILES): Allow installation of symlinks to directory
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6098
Diffstat (limited to 'Tests')
5 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/FILES-directory-result.txt b/Tests/RunCMake/install/FILES-directory-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/FILES-directory-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/FILES-directory-stderr.txt b/Tests/RunCMake/install/FILES-directory-stderr.txt new file mode 100644 index 0000000..4699037 --- /dev/null +++ b/Tests/RunCMake/install/FILES-directory-stderr.txt @@ -0,0 +1 @@ +install FILES given directory diff --git a/Tests/RunCMake/install/FILES-directory.cmake b/Tests/RunCMake/install/FILES-directory.cmake new file mode 100644 index 0000000..1199cf7 --- /dev/null +++ b/Tests/RunCMake/install/FILES-directory.cmake @@ -0,0 +1,7 @@ +set(dst "${CMAKE_CURRENT_BINARY_DIR}/dst") +set(src "${CMAKE_CURRENT_BINARY_DIR}/src") + +file(MAKE_DIRECTORY "${dst}") +file(MAKE_DIRECTORY "${src}") + +install(FILES "${src}" DESTINATION "${dst}") diff --git a/Tests/RunCMake/install/FILES-symlink-to-directory.cmake b/Tests/RunCMake/install/FILES-symlink-to-directory.cmake new file mode 100644 index 0000000..ed76470 --- /dev/null +++ b/Tests/RunCMake/install/FILES-symlink-to-directory.cmake @@ -0,0 +1,9 @@ +set(dst "${CMAKE_CURRENT_BINARY_DIR}/dst") +set(src "${CMAKE_CURRENT_BINARY_DIR}/src") +set(lnk "${CMAKE_CURRENT_BINARY_DIR}/lnk") + +file(MAKE_DIRECTORY "${dst}") +file(MAKE_DIRECTORY "${src}") +file(CREATE_LINK "${src}" "${lnk}" SYMBOLIC) + +install(FILES "${lnk}" DESTINATION "${dst}") diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index efd03df..6fb72fc 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -93,6 +93,10 @@ run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all) run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc) run_cmake(FILES-DESTINATION-TYPE) run_cmake(DIRECTORY-DESTINATION-TYPE) +run_cmake(FILES-directory) +if(NOT WIN32) + run_cmake(FILES-symlink-to-directory) +endif() set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE:STRING=Debug") run_install_test(FILES-RENAME) |