Tests: Add tests for *OUTPUT_NAME properties

This commit is contained in:
Kyle Edwards
2018-07-11 16:08:27 -04:00
parent f6c7358c2a
commit ec5c838fcb
3 changed files with 44 additions and 0 deletions

View File

@@ -77,6 +77,10 @@ run_install_test(TARGETS-OPTIONAL)
run_install_test(FILES-OPTIONAL)
run_install_test(DIRECTORY-OPTIONAL)
set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE:STRING=Debug")
run_install_test(TARGETS-OUTPUT_NAME)
unset(RunCMake_TEST_OPTIONS)
set(run_install_test_components 1)
run_install_test(FILES-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-EXCLUDE_FROM_ALL)

View File

@@ -0,0 +1,13 @@
if(WIN32)
set(test123 [[bin/test1out\.exe;bin/test2deb\.exe;bin/test3exc\.exe]])
set(libtest45 [[bin/libtest4\.dll;bin/libtest4\.dll\.a;bin/libtest5ar\.a]])
set(test45 [[bin/test4\.dll;bin/test4\.lib;bin/test5ar\.lib]])
check_installed("^bin;(${libtest45};${test123})|(${test123};${test45})\$")
elseif(CYGWIN)
check_installed([[^bin;bin/cygtest4\.dll;bin/libtest4\.dll\.a;bin/libtest5ar\.a;bin/test1out\.exe;bin/test2deb\.exe;bin/test3exc\.exe$]])
elseif(APPLE)
check_installed([[^bin;bin/libtest4lib\.dylib;bin/libtest5ar\.a;bin/test1out;bin/test2deb;bin/test3exc$]])
else()
check_installed([[^bin;bin/libtest4lib\.so;bin/libtest5ar\.a;bin/test1out;bin/test2deb;bin/test3exc$]])
endif()

View File

@@ -0,0 +1,27 @@
enable_language(C)
add_executable(test1 main.c)
set_property(TARGET test1 PROPERTY OUTPUT_NAME test1out)
set_property(TARGET test1 PROPERTY RELEASE_OUTPUT_NAME test1rel)
add_executable(test2 main.c)
set_property(TARGET test2 PROPERTY OUTPUT_NAME test2out)
set_property(TARGET test2 PROPERTY DEBUG_OUTPUT_NAME test2deb)
add_executable(test3 main.c)
set_property(TARGET test3 PROPERTY RUNTIME_OUTPUT_NAME test3exc)
add_library(test4 SHARED obj1.c)
set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4lib)
add_library(test5 STATIC obj1.c)
set_property(TARGET test5 PROPERTY ARCHIVE_OUTPUT_NAME test5ar)
install(TARGETS
test1
test2
test3
test4
test5
DESTINATION bin
)