[hsa] Search libs/includes from user locations before default paths
Search for HSA libraries and includes from location specified by
DWITH_HSA_*_DIR defines before default locations. Before this commit
cmake configuration would find them from default locations first
effectively ignoring the -DWITH_HSA_*_DIR defines.
@@ -64,12 +64,14 @@ else()
endif()
-find_path(HSA_INCLUDES "hsa.h" PATHS "${HSA_INCLUDEDIR}")
+find_path(HSA_INCLUDES "hsa.h" PATHS "${HSA_INCLUDEDIR}" NO_DEFAULT_PATH)
+find_path(HSA_INCLUDES "hsa.h")
if(NOT HSA_INCLUDES)
message(FATAL_ERROR "hsa.h header not found (use -DHSA_RUNTIME_DIR=... to specify path to HSA runtime)")
endif()
-find_library(HSALIB NAMES "hsa-runtime64" "hsa-runtime" "phsa-runtime64" PATHS "${HSA_LIBDIR}")
+find_library(HSALIB NAMES "hsa-runtime64" "hsa-runtime" "phsa-runtime64" PATHS "${HSA_LIBDIR}" NO_DEFAULT_PATH)
+find_library(HSALIB NAMES "hsa-runtime64" "hsa-runtime" "phsa-runtime64")
if(NOT HSALIB)
message(FATAL_ERROR "libhsa-runtime not found (use -DWITH_HSA_RUNTIME_DIR=... to specify path to HSA runtime) ${HSA_LIBDIR}")
endif()
