[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1673-ga6c9ad4
Brad King
brad.king at kitware.com
Mon Feb 24 10:43:30 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 a6c9ad441896815c2f2b23fcedf4732ea0691951 (commit)
via 6fe466f3af1105c587035919bd2987f02436ecbc (commit)
via 6f5d65b87786fa5b1b2f38603f7d0cbce61b8760 (commit)
from 56c6259262d96a3de270db81ae2c59b84893795d (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=a6c9ad441896815c2f2b23fcedf4732ea0691951
commit a6c9ad441896815c2f2b23fcedf4732ea0691951
Merge: 56c6259 6fe466f
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Feb 24 10:43:29 2014 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Feb 24 10:43:29 2014 -0500
Merge topic 'find-hg-opencl' into next
6fe466f3 Improve FindHg documentation.
6f5d65b8 Fix FindHg breaking existing code and change casing.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fe466f3af1105c587035919bd2987f02436ecbc
commit 6fe466f3af1105c587035919bd2987f02436ecbc
Author: Matthäus G. Chajdas <cmake at anteru.net>
AuthorDate: Sun Feb 23 14:28:12 2014 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 24 10:43:10 2014 -0500
Improve FindHg documentation.
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index bf9e8a8..aa5118d 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -2,7 +2,7 @@
# FindHg
# ------
#
-#
+# Extract information from a mercurial working copy.
#
# The module defines the following variables:
#
@@ -33,6 +33,7 @@
# find_package(Hg)
# if(HG_FOUND)
# message("hg found: ${HG_EXECUTABLE}")
+# HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# message("Current revision is ${Project_WC_REVISION}")
# message("Current changeset is ${Project_WC_CHANGESET}")
# endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f5d65b87786fa5b1b2f38603f7d0cbce61b8760
commit 6f5d65b87786fa5b1b2f38603f7d0cbce61b8760
Author: Matthäus G. Chajdas <cmake at anteru.net>
AuthorDate: Sun Feb 23 08:54:24 2014 +0100
Commit: Brad King <brad.king at kitware.com>
CommitDate: Mon Feb 24 10:43:09 2014 -0500
Fix FindHg breaking existing code and change casing.
FindHg now only adds the WC_INFO macro. Both FindHg and FindOpenCL
now use lower-case CMake commands everywhere.
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index 6887175..bf9e8a8 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -1,23 +1,22 @@
#.rst:
-# FindHG
+# FindHg
# ------
#
-# Extract information from a mercurial working copy
+#
#
# The module defines the following variables:
#
# ::
#
-# Hg_EXECUTABLE - path to mercurial command line client
-# Hg_FOUND - true if the command line client was found
-# Hg_VERSION_STRING - the version of the mercurial client
-#
+# HG_EXECUTABLE - path to mercurial command line client (hg)
+# HG_FOUND - true if the command line client was found
+# HG_VERSION_STRING - the version of mercurial found
#
# If the command line client executable is found the following macro is defined:
#
# ::
#
-# Hg_WC_INFO(<dir> <var-prefix>)
+# HG_WC_INFO(<dir> <var-prefix>)
#
# Hg_WC_INFO extracts information of a mercurial working copy
# at a given location. This macro defines the following variables:
@@ -31,16 +30,17 @@
#
# ::
#
-# find_package(Hg)
-# if(Hg_FOUND)
-# Hg_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-# message("Current revision is ${Project_WC_REVISION}")
-# message("Current changeset is ${Project_WC_CHANGESET}")
-# endif()
-#
+# find_package(Hg)
+# if(HG_FOUND)
+# message("hg found: ${HG_EXECUTABLE}")
+# message("Current revision is ${Project_WC_REVISION}")
+# message("Current changeset is ${Project_WC_CHANGESET}")
+# endif()
#=============================================================================
-# Copyright 2014 Matthaeus G. Chajdas
+# Copyright 2010-2012 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike at sf-mail.de>
+# Copyright 2014 Matthaeus G. Chajdas
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -52,40 +52,45 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FIND_PROGRAM(Hg_EXECUTABLE
+find_program(HG_EXECUTABLE
NAMES hg
- PATHS [HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
- [HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\TortoiseHG]
- DOC "hg command line client")
-MARK_AS_ADVANCED(Hg_EXECUTABLE)
+ PATHS
+ [HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
+ [HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\TortoiseHG]
+ PATH_SUFFIXES Mercurial
+ DOC "hg command line client"
+ )
+mark_as_advanced(HG_EXECUTABLE)
-IF(Hg_EXECUTABLE)
- EXECUTE_PROCESS(COMMAND ${Hg_EXECUTABLE} --version
- OUTPUT_VARIABLE Hg_VERSION
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(Hg_VERSION MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)")
- SET(Hg_VERSION_STRING "${CMAKE_MATCH_1}")
- ENDIF()
- UNSET(Hg_VERSION)
+if(HG_EXECUTABLE)
+ execute_process(COMMAND ${HG_EXECUTABLE} --version
+ OUTPUT_VARIABLE hg_version
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)")
+ set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
+ endif()
+ unset(hg_version)
- MACRO(Hg_WC_INFO dir prefix)
- EXECUTE_PROCESS(COMMAND ${Hg_EXECUTABLE} id -i -n
+ macro(HG_WC_INFO dir prefix)
+ execute_process(COMMAND ${HG_EXECUTABLE} id -i -n
WORKING_DIRECTORY ${dir}
- ERROR_VARIABLE Hg_ERROR
+ RESULT_VARIABLE hg_id_result
+ ERROR_VARIABLE hg_id_error
OUTPUT_VARIABLE ${prefix}_WC_DATA
OUTPUT_STRIP_TRAILING_WHITESPACE)
- IF(NOT ${Hg_error} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${Hg_EXECUTBALE} id -n\" in directory ${dir} failed with output:\n${Hg_ERROR}")
- ENDIF()
+ if(NOT ${hg_id_result} EQUAL 0)
+ message(SEND_ERROR "Command \"${HG_EXECUTBALE} id -n\" in directory ${dir} failed with output:\n${hg_id_error}")
+ endif()
- STRING(REGEX REPLACE "([0-9a-f]+)\\+? [0-9]+\\+?" "\\1" ${prefix}_WC_CHANGESET ${${prefix}_WC_DATA})
- STRING(REGEX REPLACE "[0-9a-f]+\\+? ([0-9]+)\\+?" "\\1" ${prefix}_WC_REVISION ${${prefix}_WC_DATA})
- ENDMACRO(Hg_WC_INFO)
-ENDIF(Hg_EXECUTABLE)
+ string(REGEX REPLACE "([0-9a-f]+)\\+? [0-9]+\\+?" "\\1" ${prefix}_WC_CHANGESET ${${prefix}_WC_DATA})
+ string(REGEX REPLACE "[0-9a-f]+\\+? ([0-9]+)\\+?" "\\1" ${prefix}_WC_REVISION ${${prefix}_WC_DATA})
+ endmacro(HG_WC_INFO)
+endif()
-INCLUDE(FindPackageHandleStandardArgs)
+# Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if
+# all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(Hg
- FOUND_VAR Hg_FOUND
- REQUIRED_VARS Hg_EXECUTABLE
- VERSION_VAR Hg_VERSION_STRING)
+ REQUIRED_VARS HG_EXECUTABLE
+ VERSION_VAR HG_VERSION_STRING)
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index e82a04e..d50eb3f 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -28,37 +28,37 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-FUNCTION(_FIND_OPENCL_VERSION)
- INCLUDE(CheckSymbolExists)
- INCLUDE(CMakePushCheckState)
+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}")
+ foreach(VERSION "2_0" "1_2" "1_1" "1_0")
+ set(CMAKE_REQUIRED_INCLUDES "${OpenCL_INCLUDE_DIR}")
- IF(APPLE)
+ if(APPLE)
CHECK_SYMBOL_EXISTS(
CL_VERSION_${VERSION}
"${OpenCL_INCLUDE_DIR}/OpenCL/cl.h"
OPENCL_VERSION_${VERSION})
- ELSE()
+ else()
CHECK_SYMBOL_EXISTS(
CL_VERSION_${VERSION}
"${OpenCL_INCLUDE_DIR}/CL/cl.h"
OPENCL_VERSION_${VERSION})
- ENDIF()
+ endif()
- IF(OPENCL_VERSION_${VERSION})
- STRING(REPLACE "_" "." VERSION "${VERSION}")
- SET(OpenCL_VERSION_STRING ${VERSION} CACHE
+ if(OPENCL_VERSION_${VERSION})
+ string(REPLACE "_" "." VERSION "${VERSION}")
+ set(OpenCL_VERSION_STRING ${VERSION} CACHE
STRING "Highest supported OpenCL version")
- BREAK()
- ENDIF()
- ENDFOREACH()
+ break()
+ endif()
+ endforeach()
CMAKE_POP_CHECK_STATE()
-ENDFUNCTION()
+endfunction()
-FIND_PATH(OpenCL_INCLUDE_DIR
+find_path(OpenCL_INCLUDE_DIR
NAMES
CL/cl.h OpenCL/cl.h
PATHS ENV
@@ -74,9 +74,9 @@ FIND_PATH(OpenCL_INCLUDE_DIR
_FIND_OPENCL_VERSION()
-IF(WIN32)
- IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
- FIND_LIBRARY(OpenCL_LIBRARY
+if(WIN32)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ find_library(OpenCL_LIBRARY
NAMES OpenCL
PATHS ENV
"PROGRAMFILES(X86)"
@@ -90,8 +90,8 @@ IF(WIN32)
lib/x86
lib/Win32
OpenCL/common/lib/Win32)
- ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- FIND_LIBRARY(OpenCL_LIBRARY
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ find_library(OpenCL_LIBRARY
NAMES OpenCL
PATHS ENV
"PROGRAMFILES(X86)"
@@ -105,22 +105,22 @@ IF(WIN32)
lib/x86_64
lib/x64
OpenCL/common/lib/x64)
- ENDIF()
-ELSE()
- FIND_LIBRARY(OpenCL_LIBRARY
+ endif()
+else()
+ find_library(OpenCL_LIBRARY
NAMES OpenCL)
-ENDIF()
+endif()
-SET(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
+set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
-include(FindPackageHandleStandardArgs)
+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(
+mark_as_advanced(
OpenCL_INCLUDE_DIR
OpenCL_LIBRARY
OpenCL_LIBRARIES
-----------------------------------------------------------------------
Summary of changes:
Modules/FindHg.cmake | 92 ++++++++++++++++++++++++----------------------
Modules/FindOpenCL.cmake | 56 ++++++++++++++--------------
2 files changed, 77 insertions(+), 71 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list