From 9b9c49596e0c96cec8a0e21390d27938f284d401 Mon Sep 17 00:00:00 2001 From: Freddy Paul Date: Wed, 2 Feb 2022 15:46:31 -0800 Subject: [PATCH] hip:Fix and install cmake targets for hip package hip-targets.cmake was missing from the install after the switch to new method. Added hip-targets, hip-lang-targets for the build type and fixed hard coding to ROCm install path. Change-Id: Idd6d58f9eeeca6d9dc5ac8632d6ffb4956d845e1 [ROCm/clr commit: 8c3965ec55ca8079aee06a71753cc97216970476] --- projects/clr/hipamd/packaging/CMakeLists.txt | 21 +++++--------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/projects/clr/hipamd/packaging/CMakeLists.txt b/projects/clr/hipamd/packaging/CMakeLists.txt index ca368f9da5..58ba334104 100644 --- a/projects/clr/hipamd/packaging/CMakeLists.txt +++ b/projects/clr/hipamd/packaging/CMakeLists.txt @@ -53,26 +53,15 @@ if(HIP_PLATFORM STREQUAL "amd" ) install(FILES ${CMAKE_BINARY_DIR}/lib/libamdhip64.a DESTINATION lib COMPONENT binary) endif()#End BUILD_SHARED_LIBS -#TODO:This do not belog in BINARY package. +#TODO:This do not belong in BINARY package. #Keeping it as is for now install(FILES ${CMAKE_BINARY_DIR}/.hipInfo DESTINATION lib COMPONENT binary) install(FILES ${CMAKE_BINARY_DIR}/hip-config.cmake ${CMAKE_BINARY_DIR}/hip-config-version.cmake DESTINATION lib/cmake/hip COMPONENT binary) -install(FILES ${CMAKE_BINARY_DIR}/src/hip-lang-config.cmake ${CMAKE_BINARY_DIR}/src/hip-lang-config-version.cmake DESTINATION lib/cmake/hip-lang COMPONENT binary) -## cmake generated target files contains IMPORTED_LOCATION_RELEASE etc. which -## is installation path when building the project, which may be different from -## the intallation path for packaging. These paths have to be replaced by -## the package installation path, otherwise apps using pkg-config will fail. -file(GLOB _target_files ${CONFIG_PACKAGE_INSTALL_DIR}/hip-targets*.cmake) -foreach(_target_file ${_target_files}) - execute_process(COMMAND sed -i s:${CMAKE_INSTALL_PREFIX}:${CPACK_INSTALL_PREFIX}:g ${_target_file}) -endforeach() -install(FILES ${_target_files} DESTINATION lib/cmake/hip COMPONENT BINARY) +install ( EXPORT hip-targets FILE hip-targets.cmake NAMESPACE hip:: DESTINATION lib/cmake/hip COMPONENT binary) -file(GLOB _target_files ${CONFIG_LANG_PACKAGE_INSTALL_DIR}/hip-lang-targets*.cmake) -foreach(_target_file ${_target_files}) - execute_process(COMMAND sed -i s:{CMAKE_INSTALL_PREFIX}:${CPACK_INSTALL_PREFIX}:g ${_target_file}) -endforeach() -install(FILES ${_target_files} DESTINATION lib/cmake/hip-lang COMPONENT BINARY) +install(FILES ${CMAKE_BINARY_DIR}/src/hip-lang-config.cmake ${CMAKE_BINARY_DIR}/src/hip-lang-config-version.cmake DESTINATION lib/cmake/hip-lang COMPONENT binary) + +install ( EXPORT hip-lang-targets FILE hip-lang-targets.cmake NAMESPACE hip-lang:: DESTINATION lib/cmake/hip-lang COMPONENT binary) endif()#End HIP_PLATFORM = "amd" #End bianry files install