diff options
author | Jens Carl <jcarl@teradici.com> | 2021-05-06 19:45:56 (GMT) |
---|---|---|
committer | Jens Carl <jcarl@teradici.com> | 2021-05-06 22:29:51 (GMT) |
commit | d71a7cc19d6e03f89581efdaa8d63db216184d40 (patch) | |
tree | 2d777e51528e7c7c7218f10dde2d2b3ee3fd4919 /Tests/RunCMake/install | |
parent | 5cbbe3d301838b361f7ff9ae7e09dc10ce089957 (diff) | |
download | CMake-d71a7cc19d6e03f89581efdaa8d63db216184d40.zip CMake-d71a7cc19d6e03f89581efdaa8d63db216184d40.tar.gz CMake-d71a7cc19d6e03f89581efdaa8d63db216184d40.tar.bz2 |
install(FILES): Allow installation of symlinks to directory
Allow symbolic links to a directory to be installed via install(FILES ...).
Fixes: #22159
Diffstat (limited to 'Tests/RunCMake/install')
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) |