[Cmake-commits] CMake branch, next, updated. v3.4.2-2049-gcfdb9ac

Brad King brad.king at kitware.com
Wed Jan 20 09:31:23 EST 2016


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  cfdb9ace020af28dd226790a9d7165712bf45718 (commit)
       via  e00e292afda204ed9a52abdc3ee317d6ad71b172 (commit)
      from  664b407ec54aa38ddb189128ba2baf81e78efab7 (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cfdb9ace020af28dd226790a9d7165712bf45718
commit cfdb9ace020af28dd226790a9d7165712bf45718
Merge: 664b407 e00e292
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 20 09:31:22 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 20 09:31:22 2016 -0500

    Merge topic 'add-FindXalanC' into next
    
    e00e292a FindXalanC: New module to find the Apache Xalan-C++ library


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e00e292afda204ed9a52abdc3ee317d6ad71b172
commit e00e292afda204ed9a52abdc3ee317d6ad71b172
Author:     Roger Leigh <rleigh at codelibre.net>
AuthorDate: Tue Jan 19 13:32:38 2016 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 20 09:29:00 2016 -0500

    FindXalanC: New module to find the Apache Xalan-C++ library

diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index c9219d5..10f05df 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -213,6 +213,7 @@ All Modules
    /module/FindwxWidgets
    /module/FindwxWindows
    /module/FindXCTest
+   /module/FindXalanC
    /module/FindXercesC
    /module/FindX11
    /module/FindXMLRPC
diff --git a/Help/module/FindXalanC.rst b/Help/module/FindXalanC.rst
new file mode 100644
index 0000000..b99d212
--- /dev/null
+++ b/Help/module/FindXalanC.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindXalanC.cmake
diff --git a/Help/release/dev/FindXalanC.rst b/Help/release/dev/FindXalanC.rst
new file mode 100644
index 0000000..1617253
--- /dev/null
+++ b/Help/release/dev/FindXalanC.rst
@@ -0,0 +1,5 @@
+FindXalanC
+----------
+
+* A new module to find the Apache Xalan-C++ XSL transform processing
+  library.
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
new file mode 100644
index 0000000..016b7aa
--- /dev/null
+++ b/Modules/FindXalanC.cmake
@@ -0,0 +1,162 @@
+#.rst:
+# FindXalanC
+# -----------
+#
+# Find the Apache Xalan-C++ XSL transform processor headers and libraries.
+#
+# Imported targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following :prop_tgt:`IMPORTED` targets:
+#
+# ``XalanC::XalanC``
+#   The Xalan-C++ ``xalan-c`` library, if found.
+#
+# Result variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module will set the following variables in your project:
+#
+# ``XalanC_FOUND``
+#   true if the Xalan headers and libraries were found
+# ``XalanC_VERSION``
+#   Xalan release version
+# ``XalanC_INCLUDE_DIRS``
+#   the directory containing the Xalan headers; note
+#   ``XercesC_INCLUDE_DIRS`` is also required
+# ``XalanC_LIBRARIES``
+#   Xalan libraries to be linked; note ``XercesC_LIBRARIES`` is also
+#   required
+#
+# Cache variables
+# ^^^^^^^^^^^^^^^
+#
+# The following cache variables may also be set:
+#
+# ``XalanC_INCLUDE_DIR``
+#   the directory containing the Xalan headers
+# ``XalanC_LIBRARY``
+#   the Xalan library
+
+# Written by Roger Leigh <rleigh at codelibre.net>
+
+#=============================================================================
+# Copyright 2016 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(_XalanC_GET_VERSION  version_hdr)
+    file(STRINGS ${version_hdr} _contents REGEX "^[ \t]*#define XALAN_VERSION_.*")
+    if(_contents)
+        string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" XalanC_MAJOR "${_contents}")
+        string(REGEX REPLACE "[^*]*#define XALAN_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" XalanC_MINOR "${_contents}")
+        string(REGEX REPLACE "[^*]*#define XALAN_VERSION_REVISION[ \t]+([0-9]+).*" "\\1" XalanC_PATCH "${_contents}")
+
+        if(NOT XalanC_MAJOR MATCHES "^[0-9]+$")
+            message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_MAJOR!")
+        endif()
+        if(NOT XalanC_MINOR MATCHES "^[0-9]+$")
+            message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_MINOR!")
+        endif()
+        if(NOT XalanC_PATCH MATCHES "^[0-9]+$")
+            message(FATAL_ERROR "Version parsing failed for XALAN_VERSION_REVISION!")
+        endif()
+
+        set(XalanC_VERSION "${XalanC_MAJOR}.${XalanC_MINOR}.${XalanC_PATCH}" PARENT_SCOPE)
+        set(XalanC_VERSION_MAJOR "${XalanC_MAJOR}" PARENT_SCOPE)
+        set(XalanC_VERSION_MINOR "${XalanC_MINOR}" PARENT_SCOPE)
+        set(XalanC_VERSION_PATCH "${XalanC_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(XalanC_INCLUDE_DIR
+          NAMES "xalanc/XalanTransformer/XalanTransformer.hpp"
+          DOC "Xalan-C++ include directory")
+mark_as_advanced(XalanC_INCLUDE_DIR)
+
+if(XalanC_INCLUDE_DIR)
+  _XalanC_GET_VERSION("${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
+endif()
+
+if(NOT XalanC_LIBRARY)
+  # Find all XalanC libraries
+  find_library(XalanC_LIBRARY_RELEASE
+               NAMES "Xalan-C" "xalan-c"
+                     "Xalan-C_${XalanC_VERSION_MAJOR}"
+                     "Xalan-C_${XalanC_VERSION_MAJOR}_${XalanC_VERSION_MINOR}"
+               DOC "Xalan-C++ libraries (release)")
+  find_library(XalanC_LIBRARY_DEBUG
+               NAMES "Xalan-CD" "xalan-cd"
+                     "Xalan-C_${XalanC_VERSION_MAJOR}D"
+                     "Xalan-C_${XalanC_VERSION_MAJOR}_${XalanC_VERSION_MINOR}D"
+               DOC "Xalan-C++ libraries (debug)")
+  include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+  select_library_configurations(XalanC)
+  mark_as_advanced(XalanC_LIBRARY_RELEASE XalanC_LIBRARY_DEBUG)
+endif()
+
+unset(XalanC_VERSION_MAJOR)
+unset(XalanC_VERSION_MINOR)
+unset(XalanC_VERSION_PATCH)
+
+unset(XalanC_XERCESC_REQUIRED)
+if(XalanC_FIND_REQUIRED)
+  set(XalanC_XERCESC_REQUIRED REQUIRED)
+endif()
+find_package(XercesC ${XalanC_XERCESC_REQUIRED})
+unset(XalanC_XERCESC_REQUIRED)
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(XalanC
+                                  FOUND_VAR XalanC_FOUND
+                                  REQUIRED_VARS XalanC_LIBRARY
+                                                XalanC_INCLUDE_DIR
+                                                XalanC_VERSION
+                                                XercesC_FOUND
+                                  VERSION_VAR XalanC_VERSION
+                                  FAIL_MESSAGE "Failed to find XalanC")
+
+if(XalanC_FOUND)
+  set(XalanC_INCLUDE_DIRS "${XalanC_INCLUDE_DIR}" ${XercesC_INCLUDE_DIRS})
+  set(XalanC_LIBRARIES "${XalanC_LIBRARY}" ${XercesC_LIBRARIES})
+
+  # For header-only libraries
+  if(NOT TARGET XalanC::XalanC)
+    add_library(XalanC::XalanC UNKNOWN IMPORTED)
+    if(XalanC_INCLUDE_DIRS)
+      set_target_properties(XalanC::XalanC PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${XalanC_INCLUDE_DIRS}")
+    endif()
+    if(EXISTS "${XalanC_LIBRARY}")
+      set_target_properties(XalanC::XalanC PROPERTIES
+        IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+        IMPORTED_LOCATION "${XalanC_LIBRARY}")
+    endif()
+    if(EXISTS "${XalanC_LIBRARY_DEBUG}")
+      set_property(TARGET XalanC::XalanC APPEND PROPERTY
+        IMPORTED_CONFIGURATIONS DEBUG)
+      set_target_properties(XalanC::XalanC PROPERTIES
+        IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+        IMPORTED_LOCATION_DEBUG "${XalanC_LIBRARY_DEBUG}")
+    endif()
+    if(EXISTS "${XalanC_LIBRARY_RELEASE}")
+      set_property(TARGET XalanC::XalanC APPEND PROPERTY
+        IMPORTED_CONFIGURATIONS RELEASE)
+      set_target_properties(XalanC::XalanC PROPERTIES
+        IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+        IMPORTED_LOCATION_RELEASE "${XalanC_LIBRARY_RELEASE}")
+    endif()
+    set_target_properties(XalanC::XalanC PROPERTIES INTERFACE_LINK_LIBRARIES XercesC::XercesC)
+  endif()
+endif()
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 043b757..240144f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1379,6 +1379,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
     add_subdirectory(FindTIFF)
   endif()
 
+  if(CMake_TEST_FindXalanC)
+    add_subdirectory(FindXalanC)
+  endif()
+
   if(CMake_TEST_FindXercesC)
     add_subdirectory(FindXercesC)
   endif()
diff --git a/Tests/FindXalanC/CMakeLists.txt b/Tests/FindXalanC/CMakeLists.txt
new file mode 100644
index 0000000..7872929
--- /dev/null
+++ b/Tests/FindXalanC/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindXalanC.Test COMMAND
+  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+  --build-and-test
+  "${CMake_SOURCE_DIR}/Tests/FindXalanC/Test"
+  "${CMake_BINARY_DIR}/Tests/FindXalanC/Test"
+  ${build_generator_args}
+  --build-project TestFindXalanC
+  --build-options ${build_options}
+  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+  )
diff --git a/Tests/FindXalanC/Test/CMakeLists.txt b/Tests/FindXalanC/Test/CMakeLists.txt
new file mode 100644
index 0000000..b445e0e
--- /dev/null
+++ b/Tests/FindXalanC/Test/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.1)
+project(TestFindXalanC CXX)
+include(CTest)
+
+# CMake does not actually provide FindXalanC publicly.
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules)
+
+find_package(XalanC REQUIRED)
+
+add_executable(test_xalanc_tgt main.cxx)
+target_link_libraries(test_xalanc_tgt XalanC::XalanC)
+add_test(NAME test_xalanc_tgt COMMAND test_xalanc_tgt)
+
+add_executable(test_xalanc_var main.cxx)
+target_include_directories(test_xalanc_var PRIVATE ${XalanC_INCLUDE_DIRS})
+target_link_libraries(test_xalanc_var PRIVATE ${XalanC_LIBRARIES})
+add_test(NAME test_xalanc_var COMMAND test_xalanc_var)
diff --git a/Tests/FindXalanC/Test/main.cxx b/Tests/FindXalanC/Test/main.cxx
new file mode 100644
index 0000000..3b4a2df
--- /dev/null
+++ b/Tests/FindXalanC/Test/main.cxx
@@ -0,0 +1,10 @@
+#include <xercesc/util/PlatformUtils.hpp>
+#include <xalanc/XalanTransformer/XalanTransformer.hpp>
+
+int main()
+{
+  xercesc::XMLPlatformUtils::Initialize();
+  xalanc::XalanTransformer::initialize();
+  xalanc::XalanTransformer::terminate();
+  xercesc::XMLPlatformUtils::Terminate();
+}

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list