diff options
author | Brad King <brad.king@kitware.com> | 2017-03-01 17:38:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-02 13:36:32 (GMT) |
commit | 69528fe65f0c4402c6560917d6cb118d2c103445 (patch) | |
tree | 3ac7a7fd0523198d44a05b37ccd2777b0d83e833 /Tests/RunCMake/RuntimePath/SymlinkImplicit.cmake | |
parent | f3102ca884496a4a0644dc43afaf80a253191ed8 (diff) | |
download | CMake-69528fe65f0c4402c6560917d6cb118d2c103445.zip CMake-69528fe65f0c4402c6560917d6cb118d2c103445.tar.gz CMake-69528fe65f0c4402c6560917d6cb118d2c103445.tar.bz2 |
Tests: Add case for RPATH exclusion of symlinks to implicit directories
Issue: #16682
Diffstat (limited to 'Tests/RunCMake/RuntimePath/SymlinkImplicit.cmake')
-rw-r--r-- | Tests/RunCMake/RuntimePath/SymlinkImplicit.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/RuntimePath/SymlinkImplicit.cmake b/Tests/RunCMake/RuntimePath/SymlinkImplicit.cmake new file mode 100644 index 0000000..6578f8f --- /dev/null +++ b/Tests/RunCMake/RuntimePath/SymlinkImplicit.cmake @@ -0,0 +1,17 @@ +enable_language(C) + +set(lib_dir ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(lib_link ${CMAKE_CURRENT_BINARY_DIR}/libLink) +set(lib_always ${CMAKE_CURRENT_BINARY_DIR}/libAlways) +file(MAKE_DIRECTORY ${lib_dir}) +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink lib ${lib_link}) +execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink lib ${lib_always}) + +add_library(A SHARED A.c) +list(APPEND CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${lib_dir}) +set_property(TARGET A PROPERTY LIBRARY_OUTPUT_DIRECTORY ${lib_link}) + +add_executable(exe main.c) +target_link_libraries(exe A) +set_property(TARGET exe PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +set_property(TARGET exe PROPERTY BUILD_RPATH ${lib_always}) |