mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Now that these cases are in a dedicated test we can drop the `file-GET_RUNTIME_DEPENDENCIES-` prefix from their name.
19 lines
721 B
CMake
19 lines
721 B
CMake
enable_language(C)
|
|
|
|
file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n")
|
|
add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
|
|
file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "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 "^@rpath/libunresolved\\.dylib$"
|
|
PRE_EXCLUDE_REGEXES ".*"
|
|
LIBRARIES
|
|
"${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:testlib>"
|
|
)
|
|
message(FATAL_ERROR "This message should not be displayed")
|
|
]])
|