From 585741a040a635d4d94dd20df51791909b46bee6 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 27 Apr 2020 11:05:33 -0400 Subject: [PATCH] Use find_package to find rocclr Maintain compatability with current hardcoded scheme for now for commit order convenience. Change-Id: I0b8299fceab1cc405ae5f26a129f2f1ea3d56773 --- opencl/amdocl/CMakeLists.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/opencl/amdocl/CMakeLists.txt b/opencl/amdocl/CMakeLists.txt index e9a1a1fad6..b0beb97b57 100644 --- a/opencl/amdocl/CMakeLists.txt +++ b/opencl/amdocl/CMakeLists.txt @@ -22,8 +22,21 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$") add_definitions(-DDEBUG) endif() -# FIXME: Use find_package -include(${LIBVDI_STATIC_DIR}/amdvdi_staticTargets.cmake) +# FIXME: VDI_DIR and LIBVDI_STATIC_DIR are for compatability with +# current build scripts. Instead they should install, or use +# CMAKE_PREFIX_PATH +find_package(ROCclr CONFIG + PATHS + ${VDI_DIR} + ${LIBVDI_STATIC_DIR}) + +if(NOT ROCclr_FOUND) + # FIXME: Make ROCclr find required and remove this. + # + # This is to break the dependency on patch to start producing find + # module. + include(${LIBVDI_STATIC_DIR}/amdvdi_staticTargets.cmake) +endif() include_directories(${CMAKE_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/khronos)