From 9cb358b157c45c05d4a1c98ef3d1cb5b840d9385 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Thu, 31 Aug 2023 22:43:19 +0530 Subject: [PATCH] SWDEV-415414 - Corrected the IMPORT_PREFIX path in FindHIP.cmake (#3308) The IMPORT_PREFIX path in FindHIP.cmake was generated as /hip rather than in Linux OS With file reorg backward compatibility turned off, the path /hip is no more valid Corrected the same, so that IMPORT_PREFIX will always be generated as Change-Id: I60b8ee5085c1b4eda0a8494d7f8e1e55accd2f82 --- cmake/FindHIP.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake index 29abcd7870..4578ee0701 100644 --- a/cmake/FindHIP.cmake +++ b/cmake/FindHIP.cmake @@ -81,8 +81,16 @@ elseif (HIP_CXX_COMPILER MATCHES ".*clang\\+\\+") set(HIP_CLANG_PATH "${_HIP_CLANG_BIN_PATH}") endif() - -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH) +if(WIN32) + # In windows FindHIP.cmake is installed in /cmake + get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH) +else() + # In Linux FindHIP.cmake is installed in /lib/cmake/hip + # RealPath: /lib/cmake/hip/FindHIP.cmake + # Go 4 level up to get IMPORT PREFIX as + get_filename_component(_FILE_PATH "${CMAKE_CURRENT_LIST_FILE}" REALPATH) + get_filename_component(_IMPORT_PREFIX "${_FILE_PATH}/../../../../" ABSOLUTE) +endif() # HIP is currently not supported for apple if(NOT APPLE)