Commit 087f1e9c authored by one's avatar one
Browse files

[dtk-local-overrides] Add hiprtc-config.cmake

parent 56fcb06b
......@@ -8,6 +8,7 @@ overlay_files=(
"hip/lib/cmake/hip/hip-config.cmake 0644"
"hip/lib/cmake/hip/hip-config-amd.cmake 0644"
"hip/lib/cmake/hip/hip-config-nvidia.cmake 0644"
"lib/cmake/hiprtc/hiprtc-config.cmake 0644"
)
derived_files=(
......
# CMake package shim for DTK hiprtc.
# DTK 26.04 ships hiprtc headers and libhiprtc.so, but not hiprtcConfig.cmake.
include(FindPackageHandleStandardArgs)
set(_hiprtc_roots)
foreach(_root IN ITEMS
"$ENV{HIP_PATH}"
"$ENV{ROCM_PATH}"
"/opt/dtk/hip"
"/opt/dtk")
if(_root AND EXISTS "${_root}")
list(APPEND _hiprtc_roots "${_root}")
endif()
endforeach()
find_path(hiprtc_INCLUDE_DIR
NAMES hip/hiprtc.h
HINTS ${_hiprtc_roots}
PATH_SUFFIXES include hip/include
)
find_library(hiprtc_LIBRARY
NAMES hiprtc
HINTS ${_hiprtc_roots}
PATH_SUFFIXES lib lib64 hip/lib hip/lib64
)
find_package_handle_standard_args(hiprtc
REQUIRED_VARS hiprtc_INCLUDE_DIR hiprtc_LIBRARY
)
if(hiprtc_FOUND)
set(hiprtc_INCLUDE_DIRS "${hiprtc_INCLUDE_DIR}")
set(hiprtc_LIBRARIES "${hiprtc_LIBRARY}")
if(NOT TARGET hiprtc::hiprtc)
add_library(hiprtc::hiprtc SHARED IMPORTED)
set_target_properties(hiprtc::hiprtc PROPERTIES
IMPORTED_LOCATION "${hiprtc_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${hiprtc_INCLUDE_DIR}"
)
endif()
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment