diff --git a/share/rocm/cmake/ROCMConfig.cmake b/share/rocm/cmake/ROCMConfig.cmake index 294be856..a0d12947 100644 --- a/share/rocm/cmake/ROCMConfig.cmake +++ b/share/rocm/cmake/ROCMConfig.cmake @@ -2,4 +2,18 @@ # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### -find_package(ROCmCMakeBuildTools HINTS "${CMAKE_CURRENT_LIST_DIR}") +get_filename_component(_new_rocmcmakebuildtools_path "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) +get_filename_component(_new_rocmcmakebuildtools_path "${_new_rocmcmakebuildtools_path}" DIRECTORY) +# two directories up is sufficient for windows search, but linux search requires the share directory +get_filename_component(_new_rocmcmakebuildtools_path_linux "${_new_rocmcmakebuildtools_path}" DIRECTORY) + +include(CMakeFindDependencyMacro) + +find_dependency( + ROCmCMakeBuildTools + HINTS + "${_new_rocmcmakebuildtools_path}" + "${_new_rocmcmakebuildtools_path_linux}") + +unset(_new_rocmcmakebuildtools_path) +unset(_new_rocmcmakebuildtools_path_linux)