summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenCL.cmake
diff options
context:
space:
mode:
authorAnton Myagkov <antmya@transas.com>2018-07-16 08:37:05 (GMT)
committerBrad King <brad.king@kitware.com>2018-07-16 12:27:08 (GMT)
commitdee7bafb13c654a2d62196451f013ef40dd2120f (patch)
tree888e689bd849250f1ea38d2e0dee9c87912a467a /Modules/FindOpenCL.cmake
parent992e9d10f818ead64f08b435432a6c5b5a0f6916 (diff)
downloadCMake-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.cmake31
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})