# 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()