From 9ea86d7178cdc83aba7df83e8a92ea140047910a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 10 May 2017 23:50:20 +0200 Subject: [PATCH] CMake: enforce OpenCL package from Hunter --- libethash-cl/CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libethash-cl/CMakeLists.txt b/libethash-cl/CMakeLists.txt index 0e52383ae..e22641d15 100644 --- a/libethash-cl/CMakeLists.txt +++ b/libethash-cl/CMakeLists.txt @@ -17,16 +17,17 @@ aux_source_directory(. SRC_LIST) file(GLOB OUR_HEADERS "*.h") set(HEADERS ${OUR_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/ethash_cl_miner_kernel.h) -if(NOT APPLE) -# TODO: Take cl.hpp also from hunter. +if(APPLE) + # On macOS use system OpenCL library. + find_package(OpenCL REQUIRED) +else() hunter_add_package(OpenCL) + find_package(OpenCL CONFIG REQUIRED) endif() -find_package(OpenCL REQUIRED) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(..) add_library(ethash-cl ${SRC_LIST} ${HEADERS}) target_link_libraries(ethash-cl PUBLIC ethash) -target_link_libraries(ethash-cl PRIVATE ${OpenCL_LIBRARY}) -target_include_directories(ethash-cl PRIVATE SYSTEM ${OpenCL_INCLUDE_DIR}) +target_link_libraries(ethash-cl PRIVATE OpenCL::OpenCL)