[Cmake-commits] CMake branch, next, updated. v3.0.1-4993-g9468c3f

Rolf Eike Beer eike at sf-mail.de
Thu Aug 21 08:30:53 EDT 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  9468c3f2ddff0427a9254a96b693390061dc8e8d (commit)
       via  204070068def4e96a9207444c445225ee94bf16c (commit)
       via  4517d6b7572e4f0656759c9b361326a8604c92a9 (commit)
      from  d963457e4425185f3235c950538bd4056959889c (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=9468c3f2ddff0427a9254a96b693390061dc8e8d
commit 9468c3f2ddff0427a9254a96b693390061dc8e8d
Merge: d963457 2040700
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Aug 21 08:30:52 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Aug 21 08:30:52 2014 -0400

    Merge topic 'FindXerces' into next
    
    20407006 FindXerces: New module to find Apache Xerces-C++
    4517d6b7 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=204070068def4e96a9207444c445225ee94bf16c
commit 204070068def4e96a9207444c445225ee94bf16c
Author:     Roger Leigh <rleigh at codelibre.net>
AuthorDate: Sun Aug 17 12:58:16 2014 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu Aug 21 14:30:30 2014 +0200

    FindXerces: New module to find Apache Xerces-C++

diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index c279d50..a00479d 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -207,6 +207,7 @@ All Modules
    /module/FindWish
    /module/FindwxWidgets
    /module/FindwxWindows
+   /module/FindXerces
    /module/FindX11
    /module/FindXMLRPC
    /module/FindZLIB
diff --git a/Help/module/FindXerces.rst b/Help/module/FindXerces.rst
new file mode 100644
index 0000000..166d8dd
--- /dev/null
+++ b/Help/module/FindXerces.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindXerces.cmake
diff --git a/Modules/FindXerces.cmake b/Modules/FindXerces.cmake
new file mode 100644
index 0000000..325bb6d
--- /dev/null
+++ b/Modules/FindXerces.cmake
@@ -0,0 +1,85 @@
+#.rst:
+# FindXerces
+# ----------
+#
+# Find the Apache Xerces-C++ validating XML parser headers and libraries.
+#
+# This module reports information about the Xerces installation in
+# several variables.  General variables::
+#
+#   Xerces_FOUND - true if the Xerces headers and libraries were found
+#   Xerces_VERSION - Xerces release version
+#   Xerces_INCLUDE_DIRS - the directory containing the Xerces headers
+#   Xerces_LIBRARIES - Xerces libraries to be linked
+#
+# The following cache variables may also be set::
+#
+#   Xerces_INCLUDE_DIR - the directory containing the Xerces headers
+#   Xerces_LIBRARY - the Xerces library
+
+# Written by Roger Leigh <rleigh at codelibre.net>
+
+#=============================================================================
+# Copyright 2014 University of Dundee
+#
+# 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(_Xerces_GET_VERSION  version_hdr)
+    file(STRINGS ${version_hdr} _contents REGEX "^[ \t]*#define XERCES_VERSION_.*")
+    if(_contents)
+        string(REGEX REPLACE ".*#define XERCES_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" Xerces_MAJOR "${_contents}")
+        string(REGEX REPLACE ".*#define XERCES_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" Xerces_MINOR "${_contents}")
+        string(REGEX REPLACE ".*#define XERCES_VERSION_REVISION[ \t]+([0-9]+).*" "\\1" Xerces_PATCH "${_contents}")
+
+        if(NOT Xerces_MAJOR MATCHES "^[0-9]+$")
+            message(FATAL_ERROR "Version parsing failed for XERCES_VERSION_MAJOR!")
+        endif()
+        if(NOT Xerces_MINOR MATCHES "^[0-9]+$")
+            message(FATAL_ERROR "Version parsing failed for XERCES_VERSION_MINOR!")
+        endif()
+        if(NOT Xerces_PATCH MATCHES "^[0-9]+$")
+            message(FATAL_ERROR "Version parsing failed for XERCES_VERSION_REVISION!")
+        endif()
+
+        set(Xerces_VERSION "${Xerces_MAJOR}.${Xerces_MINOR}.${Xerces_PATCH}" PARENT_SCOPE)
+    else()
+        message(FATAL_ERROR "Include file ${version_hdr} does not exist or does not contain expected version information")
+    endif()
+endfunction()
+
+# Find include directory
+find_path(Xerces_INCLUDE_DIR
+          NAMES "xercesc/util/PlatformUtils.hpp"
+          DOC "Xerces-C++ include directory")
+mark_as_advanced(Xerces_INCLUDE_DIR)
+
+# Find all Xerces libraries
+find_library(Xerces_LIBRARY "xerces-c"
+  DOC "Xerces-C++ libraries")
+mark_as_advanced(Xerces_LIBRARY)
+
+if(Xerces_INCLUDE_DIR)
+  _Xerces_GET_VERSION("${Xerces_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xerces
+                                  FOUND_VAR Xerces_FOUND
+                                  REQUIRED_VARS Xerces_LIBRARY
+                                                Xerces_INCLUDE_DIR
+                                                Xerces_VERSION
+                                  VERSION_VAR Xerces_VERSION
+                                  FAIL_MESSAGE "Failed to find Xerces")
+
+if(Xerces_FOUND)
+  set(Xerces_INCLUDE_DIRS "${Xerces_INCLUDE_DIR}")
+  set(Xerces_LIBRARIES "${Xerces_LIBRARY}")
+endif()

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

Summary of changes:
 Help/manual/cmake-modules.7.rst |    1 +
 Help/module/FindXerces.rst      |    1 +
 Modules/FindXerces.cmake        |   85 +++++++++++++++++++++++++++++++++++++++
 Source/CMakeVersion.cmake       |    2 +-
 4 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 Help/module/FindXerces.rst
 create mode 100644 Modules/FindXerces.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list