Tests: Add test for install(DIRECTORY) with PATTERN and REGEX

This commit is contained in:
Kyle Edwards 2018-07-12 10:04:37 -04:00
parent bce8fa229a
commit 4108ab4be2
6 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1 @@
check_installed([[^dir1;dir1/empty\.c;dir1/empty\.h;dir2;dir2/pattern;dir2/pattern/empty\.txt;dir3;dir3/empty\.c;dir3/empty\.h;dir3/empty\.txt;dir4;dir4/empty\.c;dir4/empty\.h;dir4/empty\.txt;empty$]])

View File

@ -0,0 +1,36 @@
install(
DIRECTORY pattern/
DESTINATION dir1
FILES_MATCHING
PATTERN "*.h"
REGEX "\\.c$"
)
# FIXME: If/when CMake gains a good way to read file permissions, we should
# check that these permissions were set correctly.
install(
DIRECTORY pattern
DESTINATION dir2
FILE_PERMISSIONS OWNER_READ OWNER_WRITE
DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
PATTERN "*.h" EXCLUDE
REGEX "\\.c$" EXCLUDE
)
install(
DIRECTORY pattern/
DESTINATION dir3
PATTERN "*.h"
PERMISSIONS OWNER_READ OWNER_WRITE
)
install(
DIRECTORY pattern/
DESTINATION dir4
USE_SOURCE_PERMISSIONS
)
install(
DIRECTORY
DESTINATION empty
)

View File

@ -85,6 +85,7 @@ run_install_test(Deprecated)
run_install_test(PRE_POST_INSTALL_SCRIPT)
run_install_test(SCRIPT)
run_install_test(TARGETS-CONFIGURATIONS)
run_install_test(DIRECTORY-PATTERN)
set(run_install_test_components 1)
run_install_test(FILES-EXCLUDE_FROM_ALL)

View File

View File

View File