[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1755-gf8eccc4

Brad King brad.king at kitware.com
Wed Feb 26 08:53:23 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  f8eccc4f354cae5fc95f8575490f6efb269febf6 (commit)
       via  796d77f599c8cbb84532fb02f1418eeb06c41a10 (commit)
      from  6303cad7bf70ecac7e52377429a12333882f6afe (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=f8eccc4f354cae5fc95f8575490f6efb269febf6
commit f8eccc4f354cae5fc95f8575490f6efb269febf6
Merge: 6303cad 796d77f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 26 08:53:21 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 26 08:53:21 2014 -0500

    Merge topic 'add-FindOpenCL' into next
    
    796d77f5 Fix incorrect variable names/variables being stored in cache.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=796d77f599c8cbb84532fb02f1418eeb06c41a10
commit 796d77f599c8cbb84532fb02f1418eeb06c41a10
Author:     Matthäus G. Chajdas <cmake at anteru.net>
AuthorDate: Tue Feb 25 22:07:36 2014 +0100
Commit:     Matthäus G. Chajdas <cmake at anteru.net>
CommitDate: Tue Feb 25 22:07:36 2014 +0100

    Fix incorrect variable names/variables being stored in cache.
    
    This also adds OpenCL_VERSION_MAJOR and OpenCL_VERSION_MINOR to
    the list of found variables.

diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index d50eb3f..fd27aa2 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -8,11 +8,19 @@
 #
 # ::
 #
-#   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_FOUND          - True if OpenCL was found
+#   OpenCL_INCLUDE_DIRS   - include directories for OpenCL
+#   OpenCL_LIBRARIES      - link against this library to use OpenCL
 #   OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
+#   OpenCL_VERSION_MAJOR  - The major version of the OpenCL implementation
+#   OpenCL_VERSION_MINOR  - The minor version of the OpenCL implementation
+#
+# The module will also define two cache variables
+#
+# ::
+#
+#   OpenCL_INCLUDE_DIR    - the OpenCL include directory
+#   OpenCL_LIBRARY        - the path to the OpenCL library
 #
 
 #=============================================================================
@@ -50,8 +58,12 @@ function(_FIND_OPENCL_VERSION)
 
     if(OPENCL_VERSION_${VERSION})
       string(REPLACE "_" "." VERSION "${VERSION}")
-      set(OpenCL_VERSION_STRING ${VERSION} CACHE
-        STRING "Highest supported OpenCL version")
+      set(OpenCL_VERSION_STRING ${VERSION} PARENT_SCOPE)
+      string(REGEX MATCHALL "[0-9]+" version_components "${VERSION}")
+      list(GET version_components 0 major_version)
+      list(GET version_components 1 minor_version)
+      set(OpenCL_VERSION_MAJOR ${major_version} PARENT_SCOPE)
+      set(OpenCL_VERSION_MINOR ${minor_version} PARENT_SCOPE)
       break()
     endif()
   endforeach()
@@ -112,6 +124,7 @@ else()
 endif()
 
 set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
+set(OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIR})
 
 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args(
@@ -122,6 +135,4 @@ find_package_handle_standard_args(
 
 mark_as_advanced(
   OpenCL_INCLUDE_DIR
-  OpenCL_LIBRARY
-  OpenCL_LIBRARIES
-  OpenCL_VERSION_STRING)
+  OpenCL_LIBRARY)

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindOpenCL.cmake |   29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list