summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.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/linux-notfile.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/linux-notfile.cmake')
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake
new file mode 100644
index 0000000..6567438
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake
@@ -0,0 +1,30 @@
+enable_language(C)
+cmake_policy(SET CMP0095 NEW)
+
+file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n")
+file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void);
+
+int main(void)
+{
+ test();
+ return 0;
+}
+]])
+
+add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c")
+add_executable(exe "${CMAKE_BINARY_DIR}/main.c")
+target_link_libraries(exe PRIVATE test)
+set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib")
+
+install(TARGETS exe DESTINATION bin)
+
+install(CODE [[
+ file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test>")
+ file(GET_RUNTIME_DEPENDENCIES
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:exe>"
+ PRE_INCLUDE_REGEXES "^libtest\\.so$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])