Packages for test and benchmark executables on all supported OSes using CPack. (#512)

This commit is contained in:
Liam Wrubleski authored and GitHub committed 2022-03-21 15:04:14 -06:00
1 parent cd17cf6dce
commit a8f1e61f48
4 files changed
+27 -19

No files matched your search

+9 -6
View File
@@ -108,12 +108,15 @@ if(BUILD_TESTS)
# HIPCC adds /opt/rocm/lib as RPATH, even though the install process is supposed to
# remove RPATH. It also occurs before any user-specified rpath, which effectively overrides the user rpath.
# As a work-around, set the correct RPATH for the unit test executable as a post-install step
if (CMAKE_INSTALL_PREFIX MATCHES "${ROCM_PATH}")
# install_prefix/CMAKE_INSTALL_PREFIX was not explicitly specified, so look in build/release
add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTests)
else()
add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTests)
endif()
# if (CMAKE_INSTALL_PREFIX MATCHES "${ROCM_PATH}")
# # install_prefix/CMAKE_INSTALL_PREFIX was not explicitly specified, so look in build/release
# add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTests)
# else()
# add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTests)
# endif()
set_property(TARGET UnitTests PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${ROCM_PATH}/lib;${CMAKE_BINARY_DIR}")
set_property(TARGET UnitTests PROPERTY BUILD_RPATH "${CMAKE_BINARY_DIR};${ROCM_PATH}/lib")
rocm_install(TARGETS UnitTests COMPONENT tests)
else()
message("Not building unit tests")
endif()