diff options
author | Thomas White <taw@physics.org> | 2018-09-13 15:14:13 -0700 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-09-14 00:15:07 +0200 |
commit | fe29796ba464455d0089c314fc6623b8b0733a80 (patch) | |
tree | 4009859256b9f715c8f3d3b1d015cc4c1ce80e91 /CMakeLists.txt | |
parent | afcec6ab2f729c05b4d4169b6abef9f2a167725d (diff) |
Add workaround for missing /Headers in OpenCL include dir on Mac OS
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 697b0bed..fb478c4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,9 +101,16 @@ check_include_file(fcntl.h HAVE_FCNTL_H) check_include_file(stdlib.h HAVE_STDLIB_H) check_include_file(unistd.h HAVE_UNISTD_H) -# If we supposedly have OpenCL, check if the header is actually "CL/cl.h" +# Workarounds for weird OpenCL quirks.. if (OpenCL_FOUND) + + # If include path ends with "OpenCL.framework", add the missing "/Headers" + string(REGEX REPLACE "OpenCL.framework$" "OpenCL.framework/Headers" + OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIRS}) + + # Check if the header is actually "CL/cl.h" check_include_file(CL/cl.h HAVE_CL_CL_H "-I${OpenCL_INCLUDE_DIRS}") + endif (OpenCL_FOUND) # Check for nice clock function |