[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1722-g45d94ba
Brad King
brad.king at kitware.com
Tue Feb 25 11:14:56 EST 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 45d94baa2aafd344eb57f3a225d50c1077127dec (commit)
via 85f681f2735d6be009b0a5eda83ec8d87ff6ad93 (commit)
from 0e0ba3dee256ded29fd28f08f9b7ad726e3c70e6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=45d94baa2aafd344eb57f3a225d50c1077127dec
commit 45d94baa2aafd344eb57f3a225d50c1077127dec
Merge: 0e0ba3d 85f681f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Feb 25 11:14:56 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 25 11:14:56 2014 -0500
Merge topic 'add-FindOpenCL' into next
85f681f2 Add FindOpenCL module
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85f681f2735d6be009b0a5eda83ec8d87ff6ad93
commit 85f681f2735d6be009b0a5eda83ec8d87ff6ad93
Author: Matthäus G. Chajdas <cmake at anteru.net>
AuthorDate: Sat Feb 22 19:57:17 2014 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Feb 25 11:15:09 2014 -0500
Add FindOpenCL module
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 7a06be6..2bbe622 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -138,6 +138,7 @@ All Modules
/module/FindMPEG
/module/FindMPI
/module/FindOpenAL
+ /module/FindOpenCL
/module/FindOpenGL
/module/FindOpenMP
/module/FindOpenSceneGraph
diff --git a/Help/module/FindOpenCL.rst b/Help/module/FindOpenCL.rst
new file mode 100644
index 0000000..e87e289
--- /dev/null
+++ b/Help/module/FindOpenCL.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindOpenCL.cmake
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
new file mode 100644
index 0000000..d50eb3f
--- /dev/null
+++ b/Modules/FindOpenCL.cmake
@@ -0,0 +1,127 @@
+#.rst:
+# FindOpenCL
+# ----------
+#
+# Try to find OpenCL
+#
+# Once done this will define
+#
+# ::
+#
+# OpenCL_FOUND - system has OpenCL
+# OpenCL_INCLUDE_DIR - the OpenCL include directory
+# OpenCL_LIBRARIES - Link against this library to use OpenCL
+# OpenCL_LIBRARY - Path to the OpenCL library
+# OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
+#
+
+#=============================================================================
+# Copyright 2014 Matthaeus G. Chajdas
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+function(_FIND_OPENCL_VERSION)
+ include(CheckSymbolExists)
+ include(CMakePushCheckState)
+
+ CMAKE_PUSH_CHECK_STATE()
+ foreach(VERSION "2_0" "1_2" "1_1" "1_0")
+ set(CMAKE_REQUIRED_INCLUDES "${OpenCL_INCLUDE_DIR}")
+
+ if(APPLE)
+ CHECK_SYMBOL_EXISTS(
+ CL_VERSION_${VERSION}
+ "${OpenCL_INCLUDE_DIR}/OpenCL/cl.h"
+ OPENCL_VERSION_${VERSION})
+ else()
+ CHECK_SYMBOL_EXISTS(
+ CL_VERSION_${VERSION}
+ "${OpenCL_INCLUDE_DIR}/CL/cl.h"
+ OPENCL_VERSION_${VERSION})
+ endif()
+
+ if(OPENCL_VERSION_${VERSION})
+ string(REPLACE "_" "." VERSION "${VERSION}")
+ set(OpenCL_VERSION_STRING ${VERSION} CACHE
+ STRING "Highest supported OpenCL version")
+ break()
+ endif()
+ endforeach()
+ CMAKE_POP_CHECK_STATE()
+endfunction()
+
+find_path(OpenCL_INCLUDE_DIR
+ NAMES
+ CL/cl.h OpenCL/cl.h
+ PATHS ENV
+ "PROGRAMFILES(X86)"
+ AMDAPPSDKROOT
+ INTELOCLSDKROOT
+ NVSDKCOMPUTE_ROOT
+ CUDA_PATH
+ ATISTREAMSDKROOT
+ PATH_SUFFIXES
+ OpenCL/common/inc
+ "AMD APP/include")
+
+_FIND_OPENCL_VERSION()
+
+if(WIN32)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ find_library(OpenCL_LIBRARY
+ NAMES OpenCL
+ PATHS ENV
+ "PROGRAMFILES(X86)"
+ AMDAPPSDKROOT
+ INTELOCLSDKROOT
+ CUDA_PATH
+ NVSDKCOMPUTE_ROOT
+ ATISTREAMSDKROOT
+ PATH_SUFFIXES
+ "AMD APP/lib/x86"
+ lib/x86
+ lib/Win32
+ OpenCL/common/lib/Win32)
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ find_library(OpenCL_LIBRARY
+ NAMES OpenCL
+ PATHS ENV
+ "PROGRAMFILES(X86)"
+ AMDAPPSDKROOT
+ INTELOCLSDKROOT
+ CUDA_PATH
+ NVSDKCOMPUTE_ROOT
+ ATISTREAMSDKROOT
+ PATH_SUFFIXES
+ "AMD APP/lib/x86_64"
+ lib/x86_64
+ lib/x64
+ OpenCL/common/lib/x64)
+ endif()
+else()
+ find_library(OpenCL_LIBRARY
+ NAMES OpenCL)
+endif()
+
+set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(
+ OpenCL
+ FOUND_VAR OpenCL_FOUND
+ REQUIRED_VARS OpenCL_LIBRARY OpenCL_INCLUDE_DIR
+ VERSION_VAR OpenCL_VERSION_STRING)
+
+mark_as_advanced(
+ OpenCL_INCLUDE_DIR
+ OpenCL_LIBRARY
+ OpenCL_LIBRARIES
+ OpenCL_VERSION_STRING)
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list