diff options
author | Brad King <brad.king@kitware.com> | 2016-08-08 14:02:07 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-08 14:02:07 (GMT) |
commit | acf6fc6a7e95175796bb25c9be05ba26bf372b53 (patch) | |
tree | dd3f07ed27821dda2e27fc0b0637592133b82251 | |
parent | 702a5489929afd1e16adf5a2123b906e4f398e2b (diff) | |
parent | 88f2455f04ace2b5b9bf4462344bcfb52fabc85e (diff) | |
download | CMake-acf6fc6a7e95175796bb25c9be05ba26bf372b53.zip CMake-acf6fc6a7e95175796bb25c9be05ba26bf372b53.tar.gz CMake-acf6fc6a7e95175796bb25c9be05ba26bf372b53.tar.bz2 |
Merge topic 'FindOpenCL-macOS'
88f2455f FindOpenCL: Fix search on macOS.
-rw-r--r-- | Modules/FindOpenCL.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake index feda315..6acda55 100644 --- a/Modules/FindOpenCL.cmake +++ b/Modules/FindOpenCL.cmake @@ -53,7 +53,7 @@ function(_FIND_OPENCL_VERSION) if(APPLE) CHECK_SYMBOL_EXISTS( CL_VERSION_${VERSION} - "${OpenCL_INCLUDE_DIR}/OpenCL/cl.h" + "${OpenCL_INCLUDE_DIR}/Headers/cl.h" OPENCL_VERSION_${VERSION}) else() CHECK_SYMBOL_EXISTS( @@ -145,8 +145,15 @@ mark_as_advanced( OpenCL_LIBRARY) if(OpenCL_FOUND AND NOT TARGET OpenCL::OpenCL) - add_library(OpenCL::OpenCL UNKNOWN IMPORTED) + if(OpenCL_LIBRARY MATCHES "/([^/]+)\\.framework$") + add_library(OpenCL::OpenCL INTERFACE IMPORTED) + set_target_properties(OpenCL::OpenCL PROPERTIES + INTERFACE_LINK_LIBRARIES "${OpenCL_LIBRARY}") + else() + add_library(OpenCL::OpenCL UNKNOWN IMPORTED) + set_target_properties(OpenCL::OpenCL PROPERTIES + IMPORTED_LOCATION "${OpenCL_LIBRARY}") + endif() set_target_properties(OpenCL::OpenCL PROPERTIES - IMPORTED_LOCATION "${OpenCL_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${OpenCL_INCLUDE_DIRS}") endif() |