diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-04-14 14:43:30 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2021-06-04 12:52:02 (GMT) |
commit | ed3633d88cc5faa6fd7eb68fdd774d6d1f9cfdc9 (patch) | |
tree | b99345e45c9645c178601669ecd5d13c18b8ab1e /Tests/RunCMake/install | |
parent | f2617cf8e6aca6ec0f8c7df6999c1f713c6d7474 (diff) | |
download | CMake-ed3633d88cc5faa6fd7eb68fdd774d6d1f9cfdc9.zip CMake-ed3633d88cc5faa6fd7eb68fdd774d6d1f9cfdc9.tar.gz CMake-ed3633d88cc5faa6fd7eb68fdd774d6d1f9cfdc9.tar.bz2 |
install(TARGETS): Add RUNTIME_DEPENDENCIES option
Diffstat (limited to 'Tests/RunCMake/install')
17 files changed, 79 insertions, 1 deletions
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index 94887a0..0f6ec70 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -44,7 +44,7 @@ function(check_installed expect) do not match what we expected: ${expect} in directory: - ${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE) + ${CMAKE_INSTALL_PREFIX}\n" PARENT_SCOPE) endif() endfunction() @@ -174,6 +174,21 @@ run_install_test(FILES-PERMISSIONS) run_install_test(TARGETS-RPATH) run_install_test(InstallRequiredSystemLibraries) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + run_cmake(TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle) + run_cmake(TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$") + run_install_test(TARGETS-RUNTIME_DEPENDENCIES-nodep) + run_install_test(TARGETS-RUNTIME_DEPENDENCIES-empty) + set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME:STRING=${CMAKE_SYSTEM_NAME}") + run_cmake(TARGETS-RUNTIME_DEPENDENCIES-cross) + unset(RunCMake_TEST_OPTIONS) +else() + run_cmake(TARGETS-RUNTIME_DEPENDENCIES-unsupported) +endif() + set(run_install_test_components 1) run_install_test(FILES-EXCLUDE_FROM_ALL) run_install_test(TARGETS-EXCLUDE_FROM_ALL) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross-result.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross-stderr.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross-stderr.txt new file mode 100644 index 0000000..b7bbb55 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TARGETS-RUNTIME_DEPENDENCIES-cross\.cmake:[0-9]+ \(install\): + install TARGETS RUNTIME_DEPENDENCIES is not supported when cross-compiling\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross.cmake new file mode 100644 index 0000000..36b2eb7 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-cross.cmake @@ -0,0 +1,4 @@ +enable_language(C) + +add_executable(exe main.c) +install(TARGETS exe RUNTIME_DEPENDENCIES) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-empty-all-check.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-empty-all-check.cmake new file mode 100644 index 0000000..dafc2a4 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-empty-all-check.cmake @@ -0,0 +1 @@ +check_installed([[^static;static/(liblib\.a|lib\.lib)$]]) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-empty.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-empty.cmake new file mode 100644 index 0000000..e46e1d9 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-empty.cmake @@ -0,0 +1,9 @@ +enable_language(C) + +add_library(lib STATIC obj1.c) + +install(TARGETS lib RUNTIME_DEPENDENCIES + LIBRARY DESTINATION lib + ARCHIVE DESTINATION static + FRAMEWORK DESTINATION fw + ) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework-result.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework-stderr.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework-stderr.txt new file mode 100644 index 0000000..6ab14f6 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework\.cmake:[0-9]+ \(install\): + install TARGETS RUNTIME_DEPENDENCIES given no FRAMEWORK DESTINATION +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework.cmake new file mode 100644 index 0000000..36b2eb7 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-no-framework.cmake @@ -0,0 +1,4 @@ +enable_language(C) + +add_executable(exe main.c) +install(TARGETS exe RUNTIME_DEPENDENCIES) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle-result.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle-stderr.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle-stderr.txt new file mode 100644 index 0000000..c7b49c7 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle\.cmake:[0-9]+ \(install\): + install A runtime dependency set may only have one bundle executable\. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle.cmake new file mode 100644 index 0000000..a848a24 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-macos-two-bundle.cmake @@ -0,0 +1,10 @@ +enable_language(C) + +add_executable(exe1 MACOSX_BUNDLE main.c) +add_executable(exe2 MACOSX_BUNDLE main.c) + +install(TARGETS exe1 exe2 + RUNTIME_DEPENDENCIES + BUNDLE DESTINATION bundles + FRAMEWORK DESTINATION fw + ) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-nodep-all-check.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-nodep-all-check.cmake new file mode 100644 index 0000000..9f455b1 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-nodep-all-check.cmake @@ -0,0 +1 @@ +check_installed([[^bin;bin/exe(\.exe)?$]]) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-nodep.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-nodep.cmake new file mode 100644 index 0000000..02466561 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-nodep.cmake @@ -0,0 +1,9 @@ +enable_language(C) + +add_executable(exe main.c) + +install(TARGETS exe + RUNTIME_DEPENDENCIES + PRE_EXCLUDE_REGEXES ".*" + FRAMEWORK DESTINATION fw + ) diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported-stderr.txt new file mode 100644 index 0000000..c098a4c --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at TARGETS-RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(install\): + install TARGETS RUNTIME_DEPENDENCIES is not supported on system "[^ +]*" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported.cmake new file mode 100644 index 0000000..36b2eb7 --- /dev/null +++ b/Tests/RunCMake/install/TARGETS-RUNTIME_DEPENDENCIES-unsupported.cmake @@ -0,0 +1,4 @@ +enable_language(C) + +add_executable(exe main.c) +install(TARGETS exe RUNTIME_DEPENDENCIES) |