summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-16 15:02:53 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-16 15:17:55 (GMT)
commit9ae33828553597c22a71ad64938a7a4d66d4ebc7 (patch)
treea92d2644cf9f8b1a85126abf5050acbdb472168c /Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake
parent248d0570c9016392feb841ffce6ac77e194aefe8 (diff)
downloadCMake-9ae33828553597c22a71ad64938a7a4d66d4ebc7.zip
CMake-9ae33828553597c22a71ad64938a7a4d66d4ebc7.tar.gz
CMake-9ae33828553597c22a71ad64938a7a4d66d4ebc7.tar.bz2
Tests: Shorten case names in RunCMake.file-GET_RUNTIME_DEPENDENCIES test
Now that these cases are in a dedicated test we can drop the `file-GET_RUNTIME_DEPENDENCIES-` prefix from their name.
Diffstat (limited to 'Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake')
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake18
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake
new file mode 100644
index 0000000..4cc74c7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n")
+add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c")
+target_link_libraries(testlib PRIVATE unresolved)
+install(TARGETS testlib DESTINATION lib)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$"
+ PRE_EXCLUDE_REGEXES ".*"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:testlib>"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])