diff options
author | Anton Myagkov <antmya@transas.com> | 2018-07-16 08:37:05 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-16 12:27:08 (GMT) |
commit | dee7bafb13c654a2d62196451f013ef40dd2120f (patch) | |
tree | 888e689bd849250f1ea38d2e0dee9c87912a467a /Modules/FindOpenCL.cmake | |
parent | 992e9d10f818ead64f08b435432a6c5b5a0f6916 (diff) | |
download | CMake-dee7bafb13c654a2d62196451f013ef40dd2120f.zip CMake-dee7bafb13c654a2d62196451f013ef40dd2120f.tar.gz CMake-dee7bafb13c654a2d62196451f013ef40dd2120f.tar.bz2 |
FindOpenCL: Search per-architecture path suffixes on UNIX
Use different path suffixes to find opencl for x86 and x86_64.
We already do this on Windows.
Diffstat (limited to 'Modules/FindOpenCL.cmake')
-rw-r--r-- | Modules/FindOpenCL.cmake | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake index 297a5fb..fe162b4 100644 --- a/Modules/FindOpenCL.cmake +++ b/Modules/FindOpenCL.cmake @@ -119,16 +119,27 @@ if(WIN32) OpenCL/common/lib/x64) endif() else() - find_library(OpenCL_LIBRARY - NAMES OpenCL - PATHS - ENV AMDAPPSDKROOT - ENV CUDA_PATH - PATH_SUFFIXES - lib/x86_64 - lib/x64 - lib - lib64) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + find_library(OpenCL_LIBRARY + NAMES OpenCL + PATHS + ENV AMDAPPSDKROOT + ENV CUDA_PATH + PATH_SUFFIXES + lib/x86 + lib) + elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) + find_library(OpenCL_LIBRARY + NAMES OpenCL + PATHS + ENV AMDAPPSDKROOT + ENV CUDA_PATH + PATH_SUFFIXES + lib/x86_64 + lib/x64 + lib + lib64) + endif() endif() set(OpenCL_LIBRARIES ${OpenCL_LIBRARY}) |