diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-05-05 15:25:38 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2021-06-04 12:52:01 (GMT) |
commit | 9f6cfe716918d7c28ddc906c49b75b922e36a8cf (patch) | |
tree | a80491b2add6eab03b4feee1190fc968c2f4760e /Tests/RunCMake | |
parent | fac22d65962111e61a0fd7650d0efec963cc10ac (diff) | |
download | CMake-9f6cfe716918d7c28ddc906c49b75b922e36a8cf.zip CMake-9f6cfe716918d7c28ddc906c49b75b922e36a8cf.tar.gz CMake-9f6cfe716918d7c28ddc906c49b75b922e36a8cf.tar.bz2 |
file: Add undocumented RPATH_SET command
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/file-RPATH/Common.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Tests/RunCMake/file-RPATH/Common.cmake b/Tests/RunCMake/file-RPATH/Common.cmake index cc1efb5..7034aad 100644 --- a/Tests/RunCMake/file-RPATH/Common.cmake +++ b/Tests/RunCMake/file-RPATH/Common.cmake @@ -62,3 +62,40 @@ foreach(f ${files}) message(FATAL_ERROR "RPATH_CHECK did not remove ${f}") endif() endforeach() + +# TODO Implement RPATH_SET in XCOFF. +if(format STREQUAL "ELF") + foreach(f ${names}) + file(COPY ${in}/${f} DESTINATION ${out} NO_SOURCE_PERMISSIONS) + endforeach() + + foreach(f ${files}) + # Set the RPATH. + file(RPATH_SET FILE "${f}" + NEW_RPATH "/new/rpath") + set(rpath) + file(STRINGS "${f}" rpath REGEX "/new/rpath" LIMIT_COUNT 1) + if(NOT rpath) + message(FATAL_ERROR "RPATH not set in ${f}") + endif() + file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1) + if(rpath) + message(FATAL_EROR "RPATH not removed in ${f}") + endif() + + # Remove the RPATH. + file(RPATH_SET FILE "${f}" + NEW_RPATH "") + set(rpath) + file(STRINGS "${f}" rpath REGEX "/new/rpath" LIMIT_COUNT 1) + if(rpath) + message(FATAL_ERROR "RPATH not removed from ${f}") + endif() + + # Check again...this should remove the file. + file(RPATH_CHECK FILE "${f}" RPATH "/new/rpath") + if(EXISTS "${f}") + message(FATAL_ERROR "RPATH_CHECK did not remove ${f}") + endif() + endforeach() +endif() |