From 964e7a8e79c069db5186ba0f9233b385f6de7ecb Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 7 Dec 2012 08:58:02 +0000
Subject: [PATCH] Task #3696: Added missing FindOpenCL.cmake

---
 .gitattributes         |  1 +
 CMake/FindOpenCL.cmake | 48 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 CMake/FindOpenCL.cmake

diff --git a/.gitattributes b/.gitattributes
index 7853af2f4e5..a6704427e17 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1971,6 +1971,7 @@ CEP/PyBDSM/test/tbdsm_process_image.py -text
 CMake/FindCasarest.cmake -text
 CMake/FindJNI.cmake -text
 CMake/FindLibssh2.cmake -text
+CMake/FindOpenCL.cmake -text
 CMake/FindValgrind.cmake -text
 CMake/TODO -text
 CMake/testscripts/assay -text
diff --git a/CMake/FindOpenCL.cmake b/CMake/FindOpenCL.cmake
new file mode 100644
index 00000000000..4a932550666
--- /dev/null
+++ b/CMake/FindOpenCL.cmake
@@ -0,0 +1,48 @@
+# - Try to find OpenCL.
+# Variables used by this module:
+#  OPENCL_ROOT_DIR     - OPENCL root directory
+# Variables defined by this module:
+#  OPENCL_FOUND        - system has OPENCL
+#  OPENCL_INCLUDE_DIR  - the OPENCL include directory (cached)
+#  OPENCL_INCLUDE_DIRS - the OPENCL include directories
+#                       (identical to OPENCL_INCLUDE_DIR)
+#  OPENCL_LIBRARY      - the OPENCL library (cached)
+#  OPENCL_LIBRARIES    - the OPENCL libraries
+#                       (identical to OPENCL_LIBRARY)
+
+# Copyright (C) 2009
+# ASTRON (Netherlands Institute for Radio Astronomy)
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
+#
+# This file is part of the LOFAR software suite.
+# The LOFAR software suite is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# The LOFAR software suite is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
+#
+# $Id: FindOpenCL.cmake 17486 2011-03-01 13:08:26Z mol $
+
+if(NOT OPENCL_FOUND)
+
+  find_path(OPENCL_INCLUDE_DIR "CL/cl.h"
+    HINTS /usr/local/cuda/include /cm/shared/apps/cuda50/toolkit/5.0.35/include) #FIXME
+  find_library(OPENCL_LIBRARY OpenCL
+    HINTS ${OPENCL_ROOT_DIR} PATH_SUFFIXES lib)
+  mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(OPENCL DEFAULT_MSG 
+    OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
+
+  set(OPENCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIR})
+  set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
+
+endif(NOT OPENCL_FOUND)
-- 
GitLab