Author: rleigh
Date: Sat Jun 3 21:43:04 2017
New Revision: 1797546
URL: http://svn.apache.org/viewvc?rev=1797546&view=rev
Log:
cmake: Add CMake build system
- Reimplement the entirely of the autoconf, automake, libtool
and pkg-config logic, including all feature tests
- Also include the MSVC logic missing from the above
- Include a full set of unit tests to reimplement the logic
in sanityTest.pl and the data in sanityTest_ExpectedResult.logs
- Obtain versioning information from configure.ac and
version.incl
- Generate and install exported CMake configuration for use by
downstream projects using CMake, to replace FindXercesC.cmake
provided by the CMake upstream
- Install documentation
- Add targets to regenerate the HTML manual and the Doxygen
API reference portably, replacing the shell script and batch
file for generating the manual
- Add targets for the documentation source files and
substitute sources so that they are visible and editable in
an IDE
- Library versioning continues to use the existing libtool
naming and numbering conventions on Unix platforms:
On Unix, the name has a -3.1 suffix before the library
extension to match the libtool -release versioning behaviour.
The symlink remains xerces-c for build time linking
- Library versioning continues to use the existing Visual
Studio project file conventions on Windows:
On Windows, the .lib and .dll names (and associated .exp, .ilk
and .pdb files) use -3[D] and -3_1[D] suffixes
This will allow building with any supported build system on any
UNIX-like platform or upon Windows, as an alternative to the GNU
autotools and MSVC version-specific project and solution files
which will behave consistently across all platforms.
The only feature of autoconf and automake which is not converted
is "make dist", and that's absolutely possible should it be
desired.
Added:
xerces/c/trunk/CMakeLists.txt
xerces/c/trunk/cmake/
xerces/c/trunk/cmake/FindICU.cmake
xerces/c/trunk/cmake/RunTest.cmake
xerces/c/trunk/cmake/XercesBool.cmake
xerces/c/trunk/cmake/XercesConst.cmake
xerces/c/trunk/cmake/XercesDLL.cmake
xerces/c/trunk/cmake/XercesFileMgrSelection.cmake
xerces/c/trunk/cmake/XercesFunctions.cmake
xerces/c/trunk/cmake/XercesICU.cmake
xerces/c/trunk/cmake/XercesIconvConst.cmake
xerces/c/trunk/cmake/XercesIncludes.cmake
xerces/c/trunk/cmake/XercesInline.cmake
xerces/c/trunk/cmake/XercesIntTypes.cmake
xerces/c/trunk/cmake/XercesLFS.cmake
xerces/c/trunk/cmake/XercesLString.cmake
xerces/c/trunk/cmake/XercesMsgLoaderSelection.cmake
xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake
xerces/c/trunk/cmake/XercesNamespaces.cmake
xerces/c/trunk/cmake/XercesNetAccessorSelection.cmake
xerces/c/trunk/cmake/XercesOperatorDelete.cmake
xerces/c/trunk/cmake/XercesPathDelimiters.cmake
xerces/c/trunk/cmake/XercesPathMax.cmake
xerces/c/trunk/cmake/XercesSSE2.cmake
xerces/c/trunk/cmake/XercesStdLibs.cmake
xerces/c/trunk/cmake/XercesStdNamespace.cmake
xerces/c/trunk/cmake/XercesTest.cmake
xerces/c/trunk/cmake/XercesTranscoderSelection.cmake
xerces/c/trunk/cmake/XercesVolatile.cmake
xerces/c/trunk/cmake/XercesWChar.cmake
xerces/c/trunk/cmake/XercesWarnings.cmake
xerces/c/trunk/cmake/XercesXMLCh.cmake
xerces/c/trunk/config.h.cmake.in
xerces/c/trunk/doc/CMakeLists.txt
xerces/c/trunk/samples/CMakeLists.txt
xerces/c/trunk/samples/expected/
xerces/c/trunk/samples/expected/CreateDOMDocument.log
xerces/c/trunk/samples/expected/DOMCount.log
xerces/c/trunk/samples/expected/DOMCount1.log
xerces/c/trunk/samples/expected/DOMCount2.log
xerces/c/trunk/samples/expected/DOMCount3.log
xerces/c/trunk/samples/expected/DOMPrint.log
xerces/c/trunk/samples/expected/DOMPrint1.log
xerces/c/trunk/samples/expected/DOMPrint2.log
xerces/c/trunk/samples/expected/DOMPrint3.log
xerces/c/trunk/samples/expected/DOMPrint4.log
xerces/c/trunk/samples/expected/DOMPrint5.log
xerces/c/trunk/samples/expected/EnumVal.log
xerces/c/trunk/samples/expected/EnumVal1.log
xerces/c/trunk/samples/expected/MemParse.log
xerces/c/trunk/samples/expected/MemParse1.log
xerces/c/trunk/samples/expected/PParse.log
xerces/c/trunk/samples/expected/PParse1.log
xerces/c/trunk/samples/expected/PParse2.log
xerces/c/trunk/samples/expected/Redirect.log
xerces/c/trunk/samples/expected/Redirect1.log
xerces/c/trunk/samples/expected/SAX2Count.log
xerces/c/trunk/samples/expected/SAX2Count1.log
xerces/c/trunk/samples/expected/SAX2Count2.log
xerces/c/trunk/samples/expected/SAX2Count3.log
xerces/c/trunk/samples/expected/SAX2Print.log
xerces/c/trunk/samples/expected/SAX2Print1.log
xerces/c/trunk/samples/expected/SAX2Print2.log
xerces/c/trunk/samples/expected/SAX2Print3.log
xerces/c/trunk/samples/expected/SAX2Print4.log
xerces/c/trunk/samples/expected/SAX2Print5.log
xerces/c/trunk/samples/expected/SAXCount.log
xerces/c/trunk/samples/expected/SAXCount1.log
xerces/c/trunk/samples/expected/SAXCount2.log
xerces/c/trunk/samples/expected/SAXCount3.log
xerces/c/trunk/samples/expected/SAXPrint.log
xerces/c/trunk/samples/expected/SAXPrint1.log
xerces/c/trunk/samples/expected/SAXPrint2.log
xerces/c/trunk/samples/expected/SAXPrint3.log
xerces/c/trunk/samples/expected/SAXPrintLong.log
xerces/c/trunk/samples/expected/SEnumVal.log
xerces/c/trunk/samples/expected/SEnumVal1.log
xerces/c/trunk/samples/expected/StdInParse1.log
xerces/c/trunk/samples/expected/StdInParse2.log
xerces/c/trunk/samples/expected/StdInParse3.log
xerces/c/trunk/src/CMakeLists.txt
xerces/c/trunk/src/XercesCConfig.cmake.in
xerces/c/trunk/src/xercesc/util/MsgLoaders/Win32/Version.rc.cmake.in
xerces/c/trunk/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in
xerces/c/trunk/tests/CMakeLists.txt
xerces/c/trunk/tests/expected/
xerces/c/trunk/tests/expected/DOMMemTest.log
xerces/c/trunk/tests/expected/DOMTest.log
xerces/c/trunk/tests/expected/DOMTraversalTest.log
xerces/c/trunk/tests/expected/DOMTypeInfoTest.log
xerces/c/trunk/tests/expected/InitTermTest.log
xerces/c/trunk/tests/expected/InitTermTest1.log
xerces/c/trunk/tests/expected/InitTermTest2.log
xerces/c/trunk/tests/expected/InitTermTest3.log
xerces/c/trunk/tests/expected/MemHandlerTest.log
xerces/c/trunk/tests/expected/MemHandlerTest1.log
xerces/c/trunk/tests/expected/MemHandlerTest2.log
xerces/c/trunk/tests/expected/RangeTest.log
xerces/c/trunk/tests/expected/ThreadTest.log
xerces/c/trunk/tests/expected/ThreadTest1.log
xerces/c/trunk/tests/expected/ThreadTest10.log
xerces/c/trunk/tests/expected/ThreadTest11.log
xerces/c/trunk/tests/expected/ThreadTest12.log
xerces/c/trunk/tests/expected/ThreadTest13.log
xerces/c/trunk/tests/expected/ThreadTest14.log
xerces/c/trunk/tests/expected/ThreadTest15.log
xerces/c/trunk/tests/expected/ThreadTest2.log
xerces/c/trunk/tests/expected/ThreadTest3.log
xerces/c/trunk/tests/expected/ThreadTest4.log
xerces/c/trunk/tests/expected/ThreadTest5.log
xerces/c/trunk/tests/expected/ThreadTest6.log
xerces/c/trunk/tests/expected/ThreadTest7.log
xerces/c/trunk/tests/expected/ThreadTest8.log
xerces/c/trunk/tests/expected/ThreadTest9.log
xerces/c/trunk/tests/expected/XSValueTest.log
xerces/c/trunk/tests/expected/XSerializerTest.log
xerces/c/trunk/tests/expected/XSerializerTest1.log
xerces/c/trunk/tests/expected/XSerializerTest2.log
xerces/c/trunk/tests/expected/XSerializerTest3.log
xerces/c/trunk/tests/expected/XSerializerTest4.log
xerces/c/trunk/tests/expected/XSerializerTest5.log
Modified:
xerces/c/trunk/Makefile.am
xerces/c/trunk/doc/build.xml
xerces/c/trunk/samples/Makefile.am
xerces/c/trunk/src/Makefile.am
xerces/c/trunk/tests/Makefile.am
Added: xerces/c/trunk/CMakeLists.txt
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/CMakeLists.txt?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/CMakeLists.txt (added)
+++ xerces/c/trunk/CMakeLists.txt Sat Jun 3 21:43:04 2017
@@ -0,0 +1,164 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Run "cmake" to generate the build files for your platform
+
+cmake_minimum_required(VERSION 3.2.0)
+
+# Use new variable expansion policy.
+if (POLICY CMP0053)
+ cmake_policy(SET CMP0053 NEW)
+endif(POLICY CMP0053)
+if (POLICY CMP0054)
+ cmake_policy(SET CMP0054 NEW)
+endif(POLICY CMP0054)
+
+# Use folders (for IDE project grouping)
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+# Source additional modules from the "cmake" directory
+list(APPEND CMAKE_MODULE_PATH
+ "${CMAKE_CURRENT_LIST_DIR}/cmake")
+
+# Read version information from configure.ac.
+file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/configure.ac" configure
+ REGEX "^AC_INIT\\(\\[xerces-c\\],\\[(.*)\\]\\)")
+foreach(line IN LISTS configure)
+ string(REGEX REPLACE "^AC_INIT\\(\\[xerces-c\\],\\[(.*)\\]\\)" "\\1"
xerces_c_version "${line}")
+ break()
+endforeach()
+
+message(STATUS "Configuring Apache Xerces-C++ version ${xerces_c_version}")
+
+# Project version
+project(xerces-c
+ VERSION "${xerces_c_version}"
+ LANGUAGES C CXX)
+enable_testing()
+
+# For autotools header compatibility
+set(PACKAGE "${PROJECT_NAME}")
+set(PACKAGE_NAME "${PROJECT_NAME}")
+set(PACKAGE_TARNAME "${PROJECT_NAME}")
+set(PACKAGE_VERSION "${PROJECT_VERSION}")
+set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set(PACKAGE_BUGREPORT "[email protected]")
+set(PACKAGE_URL "https://xerces.apache.org/xerces-c/")
+
+set(EXTRA_DIST
+ version.incl
+ xerces-c.spec
+ xerces-c.pc.in
+ CREDITS
+ INSTALL
+ KEYS
+ LICENSE
+ NOTICE
+ README
+ config/pretty-make
+ doc
+ projects
+ reconf
+ scripts/createBindingsFormatFromHPP.pl
+ scripts/makeStringDefinition.pl
+ scripts/sanityTest.pl
+ scripts/sanityTest_ExpectedResult.log
+ tools
+)
+
+include(GNUInstallDirs)
+include(XercesIncludes)
+include(XercesFunctions)
+include(XercesDLL)
+include(XercesIntTypes)
+include(XercesPathDelimiters)
+include(XercesICU)
+include(XercesMutexMgrSelection)
+include(XercesNetAccessorSelection)
+include(XercesMsgLoaderSelection)
+include(XercesTranscoderSelection)
+include(XercesFileMgrSelection)
+include(XercesXMLCh)
+include(XercesOperatorDelete)
+include(XercesBool)
+include(XercesConst)
+include(XercesInline)
+include(XercesVolatile)
+include(XercesLString)
+include(XercesNamespaces)
+include(XercesStdLibs)
+include(XercesStdNamespace)
+include(XercesSSE2)
+include(XercesPathMax)
+include(XercesWChar)
+include(XercesIconvConst)
+include(XercesLFS)
+
+# Generate headers
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h
+ @ONLY)
+configure_file(
+
${CMAKE_CURRENT_SOURCE_DIR}/src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/src/xercesc/util/Xerces_autoconf_config.hpp
+ @ONLY)
+
+# Generate pkg-config file
+set(pkgconfig-dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE STRING "pkg-config
installation directory (default ${CMAKE_INSTALL_LIBDIR}/pkgconfig)")
+set(PKGCONFIGDIR "${pkgconfig-dir}")
+
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
+set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/xerces-c.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/xerces-c.pc)
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/xerces-c.pc
+ DESTINATION "${PKGCONFIGDIR}"
+ COMPONENT "development")
+
+# Process subdirectories
+add_subdirectory(doc)
+add_subdirectory(src)
+add_subdirectory(tests)
+add_subdirectory(samples)
+
+# Display configuration summary
+message(STATUS "")
+message(STATUS "Xerces-C++ configuration summary")
+message(STATUS "--------------------------------")
+message(STATUS "")
+message(STATUS " Version: ${xerces-c_VERSION}")
+message(STATUS " Library version: ${LIB_VER}")
+message(STATUS " Library interface version D: ${LIB_INTERFACE_VER_D}")
+message(STATUS " Library interface version U: ${LIB_INTERFACE_VER_U}")
+message(STATUS "")
+message(STATUS " Installation directory: ${prefix}")
+message(STATUS " C compiler: ${CMAKE_C_COMPILER}")
+message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER}")
+message(STATUS "")
+message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
+message(STATUS " Path delimiters: \"${path_delims}\"")
+message(STATUS " File Manager: ${filemgr}")
+message(STATUS " Mutex Manager: ${mutexmgr}")
+message(STATUS " Transcoder: ${transcoder}")
+message(STATUS " NetAccessor: ${netaccessor}")
+message(STATUS " Message Loader: ${msgloader}")
Modified: xerces/c/trunk/Makefile.am
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/Makefile.am?rev=1797546&r1=1797545&r2=1797546&view=diff
==============================================================================
--- xerces/c/trunk/Makefile.am (original)
+++ xerces/c/trunk/Makefile.am Sat Jun 3 21:43:04 2017
@@ -1,6 +1,9 @@
SUBDIRS = src tests samples
EXTRA_DIST = version.incl \
+ CMakeLists.txt \
+ cmake \
+ config.h.cmake.in \
config/pretty-make \
scripts/createBindingsFormatFromHPP.pl \
scripts/makeStringDefinition.pl \
Added: xerces/c/trunk/cmake/FindICU.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/FindICU.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/FindICU.cmake (added)
+++ xerces/c/trunk/cmake/FindICU.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,359 @@
+#.rst:
+# FindICU
+# -------
+#
+# Find the International Components for Unicode (ICU) libraries and
+# programs.
+#
+# This module supports multiple components.
+# Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
+# ``lx``, ``test``, ``tu`` and ``uc``.
+#
+# Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
+# ``in`; any of the names may be used, and the appropriate
+# platform-specific library name will be automatically selected.
+#
+# This module reports information about the ICU installation in
+# several variables. General variables::
+#
+# ICU_VERSION - ICU release version
+# ICU_FOUND - true if the main programs and libraries were found
+# ICU_LIBRARIES - component libraries to be linked
+# ICU_INCLUDE_DIRS - the directories containing the ICU headers
+#
+# Imported targets::
+#
+# ICU::<C>
+#
+# Where ``<C>`` is the name of an ICU component, for example
+# ``ICU::i18n``.
+#
+# ICU programs are reported in::
+#
+# ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
+# ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
+# ICU_GENBRK_EXECUTABLE - path to genbrk executable
+# ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
+# ICU_GENRB_EXECUTABLE - path to genrb executable
+# ICU_GENDICT_EXECUTABLE - path to gendict executable
+# ICU_DERB_EXECUTABLE - path to derb executable
+# ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
+# ICU_UCONV_EXECUTABLE - path to uconv executable
+# ICU_GENCFU_EXECUTABLE - path to gencfu executable
+# ICU_MAKECONV_EXECUTABLE - path to makeconv executable
+# ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
+# ICU_GENCCODE_EXECUTABLE - path to genccode executable
+# ICU_GENSPREP_EXECUTABLE - path to gensprep executable
+# ICU_ICUPKG_EXECUTABLE - path to icupkg executable
+# ICU_GENCMN_EXECUTABLE - path to gencmn executable
+#
+# ICU component libraries are reported in::
+#
+# ICU_<C>_FOUND - ON if component was found
+# ICU_<C>_LIBRARIES - libraries for component
+#
+# Note that ``<C>`` is the uppercased name of the component.
+#
+# This module reads hints about search results from::
+#
+# ICU_ROOT - the root of the ICU installation
+#
+# The environment variable ``ICU_ROOT`` may also be used; the
+# ICU_ROOT variable takes precedence.
+#
+# The following cache variables may also be set::
+#
+# ICU_<P>_EXECUTABLE - the path to executable <P>
+# ICU_INCLUDE_DIR - the directory containing the ICU headers
+# ICU_<C>_LIBRARY - the library for component <C>
+#
+# .. note::
+#
+# In most cases none of the above variables will require setting,
+# unless multiple ICU versions are available and a specific version
+# is required.
+#
+# Other variables one may set to control this module are::
+#
+# ICU_DEBUG - Set to ON to enable debug output from FindICU.
+
+# Written by Roger Leigh <[email protected]>
+
+#=============================================================================
+# Copyright 2014-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.)
+
+set(icu_programs
+ gencnval
+ icuinfo
+ genbrk
+ icu-config
+ genrb
+ gendict
+ derb
+ pkgdata
+ uconv
+ gencfu
+ makeconv
+ gennorm2
+ genccode
+ gensprep
+ icupkg
+ gencmn)
+
+# The ICU checks are contained in a function due to the large number
+# of temporary variables needed.
+function(_ICU_FIND)
+ # Set up search paths, taking compiler into account. Search ICU_ROOT,
+ # with ICU_ROOT in the environment as a fallback if unset.
+ if(ICU_ROOT)
+ list(APPEND icu_roots "${ICU_ROOT}")
+ else()
+ if(NOT "$ENV{ICU_ROOT}" STREQUAL "")
+ file(TO_CMAKE_PATH "$ENV{ICU_ROOT}" NATIVE_PATH)
+ list(APPEND icu_roots "${NATIVE_PATH}")
+ set(ICU_ROOT "${NATIVE_PATH}"
+ CACHE PATH "Location of the ICU installation" FORCE)
+ endif()
+ endif()
+
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # 64-bit binary directory
+ set(_bin64 "bin64")
+ # 64-bit library directory
+ set(_lib64 "lib64")
+ endif()
+
+ # Generic 64-bit and 32-bit directories
+ list(APPEND icu_binary_suffixes "${_bin64}" "bin")
+ list(APPEND icu_library_suffixes "${_lib64}" "lib")
+
+ # Find all ICU programs
+ foreach(program ${icu_programs})
+ string(TOUPPER "${program}" program_upcase)
+ set(cache_var "ICU_${program_upcase}_EXECUTABLE")
+ set(program_var "ICU_${program_upcase}_EXECUTABLE")
+ find_program("${cache_var}" "${program}"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_binary_suffixes}
+ DOC "ICU ${program} executable")
+ mark_as_advanced(cache_var)
+ set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
+ endforeach()
+
+ # Find include directory
+ find_path(ICU_INCLUDE_DIR
+ NAMES "unicode/utypes.h"
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_include_suffixes}
+ DOC "ICU include directory")
+ set(ICU_INCLUDE_DIR "${ICU_INCLUDE_DIR}" PARENT_SCOPE)
+
+ # Get version
+ if(ICU_INCLUDE_DIR AND EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
+ file(STRINGS "${ICU_INCLUDE_DIR}/unicode/uvernum.h" icu_header_str
+ REGEX "^#define[\t ]+U_ICU_VERSION[\t ]+\".*\".*")
+
+ string(REGEX REPLACE "^#define[\t ]+U_ICU_VERSION[\t ]+\"([^ \\n]*)\".*"
+ "\\1" icu_version_string "${icu_header_str}")
+ set(ICU_VERSION "${icu_version_string}" PARENT_SCOPE)
+ unset(icu_header_str)
+ unset(icu_version_string)
+ endif()
+
+ # Find all ICU libraries
+ set(ICU_REQUIRED_LIBS_FOUND ON)
+ foreach(component ${ICU_FIND_COMPONENTS})
+ string(TOUPPER "${component}" component_upcase)
+ set(component_cache "ICU_${component_upcase}_LIBRARY")
+ set(component_cache_release "${component_cache}_RELEASE")
+ set(component_cache_debug "${component_cache}_DEBUG")
+ set(component_found "${component_upcase}_FOUND")
+ set(component_libnames "icu${component}")
+ set(component_debug_libnames "icu${component}d")
+
+ # Special case deliberate library naming mismatches between Unix
+ # and Windows builds
+ unset(component_libnames)
+ unset(component_debug_libnames)
+ list(APPEND component_libnames "icu${component}")
+ list(APPEND component_debug_libnames "icu${component}d")
+ if(component STREQUAL "data")
+ list(APPEND component_libnames "icudt")
+ # Note there is no debug variant at present
+ list(APPEND component_debug_libnames "icudtd")
+ endif()
+ if(component STREQUAL "dt")
+ list(APPEND component_libnames "icudata")
+ # Note there is no debug variant at present
+ list(APPEND component_debug_libnames "icudatad")
+ endif()
+ if(component STREQUAL "i18n")
+ list(APPEND component_libnames "icuin")
+ list(APPEND component_debug_libnames "icuind")
+ endif()
+ if(component STREQUAL "in")
+ list(APPEND component_libnames "icui18n")
+ list(APPEND component_debug_libnames "icui18nd")
+ endif()
+
+ find_library("${component_cache_release}" ${component_libnames}
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_library_suffixes}
+ DOC "ICU ${component} library (release)")
+ find_library("${component_cache_debug}" ${component_debug_libnames}
+ HINTS ${icu_roots}
+ PATH_SUFFIXES ${icu_library_suffixes}
+ DOC "ICU ${component} library (debug)")
+ include(SelectLibraryConfigurations)
+ select_library_configurations(ICU_${component_upcase})
+ mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
+ if(${component_cache})
+ set("${component_found}" ON)
+ list(APPEND ICU_LIBRARY "${${component_cache}}")
+ endif()
+ mark_as_advanced("${component_found}")
+ set("${component_cache}" "${${component_cache}}" PARENT_SCOPE)
+ set("${component_found}" "${${component_found}}" PARENT_SCOPE)
+ if(${component_found})
+ if (ICU_FIND_REQUIRED_${component})
+ list(APPEND ICU_LIBS_FOUND "${component} (required)")
+ else()
+ list(APPEND ICU_LIBS_FOUND "${component} (optional)")
+ endif()
+ else()
+ if (ICU_FIND_REQUIRED_${component})
+ set(ICU_REQUIRED_LIBS_FOUND OFF)
+ list(APPEND ICU_LIBS_NOTFOUND "${component} (required)")
+ else()
+ list(APPEND ICU_LIBS_NOTFOUND "${component} (optional)")
+ endif()
+ endif()
+ endforeach()
+ set(_ICU_REQUIRED_LIBS_FOUND "${ICU_REQUIRED_LIBS_FOUND}" PARENT_SCOPE)
+ set(ICU_LIBRARY "${ICU_LIBRARY}" PARENT_SCOPE)
+
+ if(NOT ICU_FIND_QUIETLY)
+ if(ICU_LIBS_FOUND)
+ message(STATUS "Found the following ICU libraries:")
+ foreach(found ${ICU_LIBS_FOUND})
+ message(STATUS " ${found}")
+ endforeach()
+ endif()
+ if(ICU_LIBS_NOTFOUND)
+ message(STATUS "The following ICU libraries were not found:")
+ foreach(notfound ${ICU_LIBS_NOTFOUND})
+ message(STATUS " ${notfound}")
+ endforeach()
+ endif()
+ endif()
+
+ if(ICU_DEBUG)
+ message(STATUS "--------FindICU.cmake search debug--------")
+ message(STATUS "ICU binary path search order: ${icu_roots}")
+ message(STATUS "ICU include path search order: ${icu_roots}")
+ message(STATUS "ICU library path search order: ${icu_roots}")
+ message(STATUS "----------------")
+ endif()
+endfunction()
+
+_ICU_FIND()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICU
+ FOUND_VAR ICU_FOUND
+ REQUIRED_VARS ICU_INCLUDE_DIR
+ ICU_LIBRARY
+ _ICU_REQUIRED_LIBS_FOUND
+ VERSION_VAR ICU_VERSION
+ FAIL_MESSAGE "Failed to find all ICU
components")
+
+unset(_ICU_REQUIRED_LIBS_FOUND)
+
+if(ICU_FOUND)
+ set(ICU_INCLUDE_DIRS "${ICU_INCLUDE_DIR}")
+ set(ICU_LIBRARIES "${ICU_LIBRARY}")
+ foreach(_ICU_component ${ICU_FIND_COMPONENTS})
+ string(TOUPPER "${_ICU_component}" _ICU_component_upcase)
+ set(_ICU_component_cache "ICU_${_ICU_component_upcase}_LIBRARY")
+ set(_ICU_component_cache_release
"ICU_${_ICU_component_upcase}_LIBRARY_RELEASE")
+ set(_ICU_component_cache_debug
"ICU_${_ICU_component_upcase}_LIBRARY_DEBUG")
+ set(_ICU_component_lib "ICU_${_ICU_component_upcase}_LIBRARIES")
+ set(_ICU_component_found "${_ICU_component_upcase}_FOUND")
+ set(_ICU_imported_target "ICU::${_ICU_component}")
+ if(${_ICU_component_found})
+ set("${_ICU_component_lib}" "${${_ICU_component_cache}}")
+ if(NOT TARGET ${_ICU_imported_target})
+ add_library(${_ICU_imported_target} UNKNOWN IMPORTED)
+ if(ICU_INCLUDE_DIR)
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${ICU_INCLUDE_DIR}")
+ endif()
+ if(EXISTS "${${_ICU_component_cache}}")
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${${_ICU_component_cache}}")
+ endif()
+ if(EXISTS "${${_ICU_component_cache_release}}")
+ set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
+ IMPORTED_LOCATION_RELEASE "${${_ICU_component_cache_release}}")
+ endif()
+ if(EXISTS "${${_ICU_component_cache_debug}}")
+ set_property(TARGET ${_ICU_imported_target} APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+ IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
+ endif()
+ endif()
+ endif()
+ unset(_ICU_component_upcase)
+ unset(_ICU_component_cache)
+ unset(_ICU_component_lib)
+ unset(_ICU_component_found)
+ unset(_ICU_imported_target)
+ endforeach()
+endif()
+
+if(ICU_DEBUG)
+ message(STATUS "--------FindICU.cmake results debug--------")
+ message(STATUS "ICU found: ${ICU_FOUND}")
+ message(STATUS "ICU_VERSION number: ${ICU_VERSION}")
+ message(STATUS "ICU_ROOT directory: ${ICU_ROOT}")
+ message(STATUS "ICU_INCLUDE_DIR directory: ${ICU_INCLUDE_DIR}")
+ message(STATUS "ICU_LIBRARIES: ${ICU_LIBRARIES}")
+
+ foreach(program IN LISTS icu_programs)
+ string(TOUPPER "${program}" program_upcase)
+ set(program_lib "ICU_${program_upcase}_EXECUTABLE")
+ message(STATUS "${program} program: ${${program_lib}}")
+ unset(program_upcase)
+ unset(program_lib)
+ endforeach()
+
+ foreach(component IN LISTS ICU_FIND_COMPONENTS)
+ string(TOUPPER "${component}" component_upcase)
+ set(component_lib "ICU_${component_upcase}_LIBRARIES")
+ set(component_found "${component_upcase}_FOUND")
+ message(STATUS "${component} library found: ${${component_found}}")
+ message(STATUS "${component} library: ${${component_lib}}")
+ unset(component_upcase)
+ unset(component_lib)
+ unset(component_found)
+ endforeach()
+ message(STATUS "----------------")
+endif()
+
+unset(icu_programs)
Added: xerces/c/trunk/cmake/RunTest.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/RunTest.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/RunTest.cmake (added)
+++ xerces/c/trunk/cmake/RunTest.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,88 @@
+# CMake tests for libtiff (common functionality)
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Written by Roger Leigh <[email protected]>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+# Run a test command, and print out any observed output discrepancies
+macro(test_command command)
+ file(MAKE_DIRECTORY "${OBSERVED_DIR}")
+
+ if(STDIN)
+ set(input INPUT_FILE "${STDIN}")
+ endif()
+
+ string(REGEX REPLACE ";" " " display_args "${ARGN}")
+ message(STATUS "Running ${command} ${display_args}")
+
+ set(ENV{XERCESC_NLS_HOME} "${NLS_HOME}")
+
+ execute_process(
+ COMMAND "${command}" ${ARGN}
+ RESULT_VARIABLE TEST_STATUS
+ ${input}
+ OUTPUT_FILE "${OBSERVED_DIR}/${NAME}.log"
+ ERROR_FILE "${OBSERVED_DIR}/${NAME}.log"
+ WORKING_DIRECTORY "${WORKDIR}")
+ if(TEST_STATUS AND NOT EXPECT_FAIL)
+ message(FATAL_ERROR "Returned failed status ${TEST_STATUS}")
+ endif()
+ if(NOT TEST_STATUS AND EXPECT_FAIL)
+ message(FATAL_ERROR "Unexpected success")
+ endif()
+
+ # Replace timings in output, and convert newlines for safe comparison
+ file(READ "${OBSERVED_DIR}/${NAME}.log" output)
+ string(REGEX REPLACE " *[0-9]+ *ms *" "{timing removed}" output "${output}")
+ file(WRITE "${OBSERVED_DIR}/${NAME}-mod.log" ${output})
+ configure_file("${OBSERVED_DIR}/${NAME}-mod.log"
"${OBSERVED_DIR}/${NAME}.log"
+ @ONLY NEWLINE_STYLE UNIX)
+ configure_file("${EXPECTED_DIR}/${NAME}.log"
"${OBSERVED_DIR}/${NAME}-exp.log"
+ @ONLY NEWLINE_STYLE UNIX)
+ file(REMOVE "${OBSERVED_DIR}/${NAME}-mod.log")
+
+ file(READ "${OBSERVED_DIR}/${NAME}.log" observed)
+ file(READ "${OBSERVED_DIR}/${NAME}-exp.log" expected)
+
+ # If the observed and expected logs differ, output a diff and fail
+ if(NOT observed STREQUAL expected)
+ if(DIFF)
+ execute_process(COMMAND ${DIFF} -u "${OBSERVED_DIR}/${NAME}-exp.log"
"${OBSERVED_DIR}/${NAME}.log")
+ endif()
+ file(REMOVE "${OBSERVED_DIR}/${NAME}-exp.log")
+ message(FATAL_ERROR "Observed output does not match expected output")
+ endif()
+ file(REMOVE "${OBSERVED_DIR}/${NAME}-exp.log")
+endmacro()
+
+# Add the directory containing libxerces-c to the PATH (Windows only)
+if(WIN32)
+ get_filename_component(LIBXERCES_C_DIR "${LIBXERCES_C}" DIRECTORY)
+ file(TO_NATIVE_PATH "${LIBXERCES_C_DIR}" LIBXERCES_C_DIR)
+ set(ENV{PATH} "${LIBXERCES_C_DIR};$ENV{PATH}")
+endif()
+if(CYGWIN)
+ get_filename_component(LIBXERCES_C_DIR "${LIBXERCES_C}" DIRECTORY)
+ file(TO_NATIVE_PATH "${LIBXERCES_C_DIR}" LIBXERCES_C_DIR)
+ set(ENV{PATH} "${LIBXERCES_C_DIR}:$ENV{PATH}")
+endif()
+
+test_command("${PROGRAM}" ${ARGS})
Added: xerces/c/trunk/cmake/XercesBool.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesBool.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesBool.cmake (added)
+++ xerces/c/trunk/cmake/XercesBool.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,38 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# bool type
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+int f(int x){return 1;}
+int f(char x){return 1;}
+int f(bool x){return 1;}
+
+int main() {
+ bool b = true;
+ return f(b);
+}"
+ HAVE_BOOL)
+
+set(XERCES_NO_NATIVE_BOOL 0)
+if(NOT HAVE_BOOL)
+ set(XERCES_NO_NATIVE_BOOL 1)
+endif()
Added: xerces/c/trunk/cmake/XercesConst.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesConst.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesConst.cmake (added)
+++ xerces/c/trunk/cmake/XercesConst.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,29 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# const keyword
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+int main() {
+ const char *s = \"Test\";
+ return 0;
+}"
+ HAVE_CONST)
Added: xerces/c/trunk/cmake/XercesDLL.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesDLL.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesDLL.cmake (added)
+++ xerces/c/trunk/cmake/XercesDLL.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,63 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Option for selection of shared or static libraries, exported as
+# cache variable
+
+set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
+
+# Add a d postfix to Debug libraries on Windows
+
+if(MSVC)
+ set(CMAKE_DEBUG_POSTFIX "d")
+endif()
+
+# DLL export and import macros
+
+set(XERCES_PLATFORM_EXPORT)
+set(XERCES_PLATFORM_IMPORT)
+set(XERCES_DLL_EXPORT)
+set(XERCES_STATIC_LIBRARY)
+if(NOT BUILD_SHARED_LIBS)
+ set(XERCES_STATIC_LIBRARY 1)
+else()
+ if(WIN32)
+ set(XERCES_PLATFORM_EXPORT "__declspec(dllexport)")
+ set(XERCES_PLATFORM_IMPORT "__declspec(dllimport)")
+ set(XERCES_DLL_EXPORT 1)
+ endif()
+endif()
+
+# Versioning information
+
+file(STRINGS "${PROJECT_SOURCE_DIR}/version.incl" icu_verinfo
+ REGEX "^[^#].*=.*")
+
+foreach(item IN LISTS icu_verinfo)
+ string(REGEX REPLACE "^([^=]+)=(.*)"
+ "\\1" lib_key "${item}")
+ string(REGEX REPLACE "^([^=]+)=(.*)"
+ "\\2" lib_value "${item}")
+ set(LIB_${lib_key} "${lib_value}")
+endforeach()
+
+string(REGEX REPLACE "^([0-9]+)_.*"
+ "\\1"
+ LIB_INTERFACE_VER_U_MAJOR
+ "${LIB_INTERFACE_VER_U}")
Added: xerces/c/trunk/cmake/XercesFileMgrSelection.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesFileMgrSelection.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesFileMgrSelection.cmake (added)
+++ xerces/c/trunk/cmake/XercesFileMgrSelection.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,42 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# file manager
+
+set(xerces_filemgr_default "POSIX")
+if(WIN32)
+ set(xerces_filemgr_default "windows")
+endif()
+
+set(file-manager "${xerces_filemgr_default}" CACHE STRING "File manager")
+set(filemgr "${file-manager}")
+
+if(NOT file-manager STREQUAL "POSIX" AND NOT file-manager STREQUAL "windows")
+ message(FATAL_ERROR "Invalid file manager type \"${file-manager}\"")
+endif()
+
+set(XERCES_USE_FILEMGR_POSIX 0)
+set(XERCES_USE_FILEMGR_WINDOWS 0)
+
+if(file-manager STREQUAL "POSIX")
+ set(XERCES_USE_FILEMGR_POSIX 1)
+endif()
+if(file-manager STREQUAL "windows")
+ set(XERCES_USE_FILEMGR_WINDOWS 1)
+endif()
Added: xerces/c/trunk/cmake/XercesFunctions.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesFunctions.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesFunctions.cmake (added)
+++ xerces/c/trunk/cmake/XercesFunctions.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,55 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# function checks
+
+include(CheckFunctionExists)
+
+check_function_exists(getcwd HAVE_GETCWD)
+check_function_exists(pathconf HAVE_PATHCONF)
+check_function_exists(realpath HAVE_REALPATH)
+check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+check_function_exists(gethostbyaddr HAVE_GETHOSTBYADDR)
+check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
+check_function_exists(socket HAVE_SOCKET)
+check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
+check_function_exists(ftime HAVE_FTIME)
+check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
+check_function_exists(memmove HAVE_MEMMOVE)
+check_function_exists(memset HAVE_MEMSET)
+check_function_exists(nl_langinfo HAVE_NL_LANGINFO)
+check_function_exists(setlocale HAVE_SETLOCALE)
+check_function_exists(localeconv HAVE_LOCALECONV)
+check_function_exists(strcasecmp HAVE_STRCASECMP)
+check_function_exists(strncasecmp HAVE_STRNCASECMP)
+check_function_exists(stricmp HAVE_STRICMP)
+check_function_exists(strnicmp HAVE_STRNICMP)
+check_function_exists(strchr HAVE_STRCHR)
+check_function_exists(strdup HAVE_STRDUP)
+check_function_exists(strrchr HAVE_STRRCHR)
+check_function_exists(strstr HAVE_STRSTR)
+check_function_exists(strtol HAVE_STRTOL)
+check_function_exists(strtoul HAVE_STRTOUL)
+check_function_exists(towupper HAVE_TOWUPPER)
+check_function_exists(towlower HAVE_TOWLOWER)
+check_function_exists(mblen HAVE_MBLEN)
+check_function_exists(wcsupr HAVE_WCSUPR)
+check_function_exists(wcslwr HAVE_WCSLWR)
+check_function_exists(wcsnicmp HAVE_WCSNICMP)
+check_function_exists(wcsicmp HAVE_WCSICMP)
Added: xerces/c/trunk/cmake/XercesICU.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesICU.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesICU.cmake (added)
+++ xerces/c/trunk/cmake/XercesICU.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,22 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Determine if ICU is available
+
+find_package(ICU COMPONENTS uc data)
Added: xerces/c/trunk/cmake/XercesIconvConst.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesIconvConst.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesIconvConst.cmake (added)
+++ xerces/c/trunk/cmake/XercesIconvConst.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,42 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# iconv const pointer
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+#include <iconv.h>
+
+int main(void) {
+ const char *fromPtr=0;
+ size_t fromLen=0;
+ char *toPtr=0;
+ size_t toLen=0;
+ iconv_t cv=0;
+ iconv(cv, &fromPtr, &fromLen, &toPtr, &toLen);
+ return 0;
+}"
+ ICONV_USES_CONST_POINTER)
+
+if(ICONV_USES_CONST_POINTER)
+ set(ICONV_USES_CONST_POINTER 1)
+else()
+ set(ICONV_USES_CONST_POINTER 0)
+endif()
Added: xerces/c/trunk/cmake/XercesIncludes.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesIncludes.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesIncludes.cmake (added)
+++ xerces/c/trunk/cmake/XercesIncludes.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,53 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# include checks
+
+include(CheckIncludeFileCXX)
+
+check_include_file_cxx(arpa/inet.h HAVE_ARPA_INET_H)
+check_include_file_cxx(dlfcn.h HAVE_DLFCN_H)
+check_include_file_cxx(fcntl.h HAVE_FCNTL_H)
+check_include_file_cxx(float.h HAVE_FLOAT_H)
+check_include_file_cxx(langinfo.h HAVE_LANGINFO_H)
+check_include_file_cxx(limits.h HAVE_LIMITS_H)
+check_include_file_cxx(locale.h HAVE_LOCALE_H)
+check_include_file_cxx(memory.h HAVE_MEMORY_H)
+check_include_file_cxx(netdb.h HAVE_NETDB_H)
+check_include_file_cxx(netinet/in.h HAVE_NETINET_IN_H)
+check_include_file_cxx(nl_types.h HAVE_NL_TYPES_H)
+check_include_file_cxx(stdbool.h HAVE_STDBOOL_H)
+check_include_file_cxx(stddef.h HAVE_STDDEF_H)
+check_include_file_cxx(stdlib.h HAVE_STDLIB_H)
+check_include_file_cxx(string.h HAVE_STRING_H)
+check_include_file_cxx(strings.h HAVE_STRINGS_H)
+check_include_file_cxx(sys/param.h HAVE_SYS_PARAM_H)
+check_include_file_cxx(sys/socket.h HAVE_SYS_SOCKET_H)
+check_include_file_cxx(sys/stat.h HAVE_SYS_STAT_H)
+check_include_file_cxx(sys/time.h HAVE_SYS_TIME_H)
+check_include_file_cxx(sys/timeb.h HAVE_SYS_TIMEB_H)
+check_include_file_cxx(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file_cxx(unistd.h HAVE_UNISTD_H)
+check_include_file_cxx(wchar.h HAVE_WCHAR_H)
+check_include_file_cxx(wctype.h HAVE_WCTYPE_H)
+check_include_file_cxx(endian.h HAVE_ENDIAN_H)
+check_include_file_cxx(machine/endian.h HAVE_MACHINE_ENDIAN_H)
+check_include_file_cxx(arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
+
+set(XERCES_HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H})
Added: xerces/c/trunk/cmake/XercesInline.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesInline.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesInline.cmake (added)
+++ xerces/c/trunk/cmake/XercesInline.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,48 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# inline keyword
+
+include(CheckCXXSourceCompiles)
+
+unset(inline_keyword)
+set(NEED_INLINE "0")
+
+# Inspired from /usr/share/autoconf/autoconf/c.m4
+foreach(test_keyword "inline" "__inline__" "__inline")
+ set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ "-Dinline=${test_keyword}")
+ check_cxx_source_compiles("
+ typedef int foo_t;
+ static inline foo_t static_foo() {return 0;}
+ foo_t foo(){return 0;}
+ int main(int argc, char *argv[]) {return 0;}"
+ CXX_HAS_${test_keyword})
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
+ if(CXX_HAS_${test_keyword})
+ if(NOT test_keyword STREQUAL "inline")
+ set(NEED_INLINE 1)
+ else()
+ set(HAVE_INLINE 1)
+ endif()
+ set(inline_keyword "${test_keyword}")
+ break()
+ endif()
+endforeach()
Added: xerces/c/trunk/cmake/XercesIntTypes.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesIntTypes.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesIntTypes.cmake (added)
+++ xerces/c/trunk/cmake/XercesIntTypes.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,142 @@
+
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Integer type checks.
+
+include(CheckIncludeFileCXX)
+include(CheckTypeSize)
+
+check_include_file_cxx(cstdint HAVE_CSTDINT)
+check_include_file_cxx(stdint.h HAVE_STDINT_H)
+check_include_file_cxx(inttypes.h HAVE_INTTYPES_H)
+set(XERCES_HAVE_CSTDINT ${HAVE_CSTDINT})
+set(XERCES_HAVE_STDINT_H ${HAVE_STDINT_H})
+set(XERCES_HAVE_INTTYPES_H ${HAVE_INTTYPES_H})
+
+# Standard typedefs
+set(CMAKE_EXTRA_INCLUDE_FILES_SAVE ${CMAKE_EXTRA_INCLUDE_FILES})
+set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "stddef.h")
+check_type_size("off_t" SIZEOF_OFF_T)
+check_type_size("size_t" SIZEOF_SIZE_T)
+check_type_size("ssize_t" SIZEOF_SSIZE_T)
+check_type_size("wchar_t" SIZEOF_WCHAR_T)
+set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES_SAVE})
+set(HAVE_OFF_T ${SIZEOF_OFF_T})
+set(HAVE_SIZE_T ${SIZEOF_SIZE_T})
+set(HAVE_SSIZE_T ${SSIZEOF_SSIZE_T})
+set(HAVE_WCHAR_T ${WCHAROF_WCHAR_T})
+if(SIZEOF_SIZE_T)
+ set(XERCES_SIZE_T size_t)
+else()
+ set(XERCES_SIZE_T unsigned long)
+endif()
+if(SIZEOF_SSIZE_T)
+ set(XERCES_SSIZE_T ssize_t)
+else()
+ set(XERCES_SSIZE_T long)
+endif()
+
+# Check type sizes
+check_type_size("short" SIZEOF_SHORT)
+check_type_size("unsigned short" SIZEOF_UNSIGNED_SHORT)
+check_type_size("int" SIZEOF_INT)
+check_type_size("unsigned int" SIZEOF_UNSIGNED_INT)
+check_type_size("long" SIZEOF_LONG)
+check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
+check_type_size("long long" SIZEOF_LONG_LONG)
+check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
+check_type_size("__int64" SIZEOF___INT64)
+check_type_size("unsigned __int64" SIZEOF_UNSIGNED__INT64)
+check_type_size("unsigned char *" SIZEOF_UNSIGNED_CHAR_P)
+
+# If this failed, set size to zero to match autoconf
+if(NOT SIZEOF___INT64)
+ set(SIZEOF___INT64 0)
+endif()
+if(NOT SIZEOF_UNSIGNED__INT64)
+ set(SIZEOF_UNSIGNED__INT64 0)
+endif()
+
+if(HAVE_CSTDINT OR HAVE_STDINT_H OR HAVE_INTTYPES_H)
+ # Use standard sized types if possible
+ set(XERCES_S16BIT_INT "int16_t")
+ set(XERCES_U16BIT_INT "uint16_t")
+ set(XERCES_S32BIT_INT "int32_t")
+ set(XERCES_U32BIT_INT "uint32_t")
+ set(XERCES_S64BIT_INT "int64_t")
+ set(XERCES_U64BIT_INT "uint64_t")
+else()
+ # Fallback to basic language types
+ if(SIZEOF_SIGNED_SHORT EQUAL 2)
+ set(XERCES_S16BIT_INT "signed short")
+ elseif(SIZEOF_INT EQUAL 2)
+ set(XERCES_S16BIT_INT "int")
+ else()
+ message(FATAL_ERROR "Couldn't find a signed 16-bit type")
+ endif()
+
+ if(SIZEOF_UNSIGNED_SHORT EQUAL 2)
+ set(XERCES_U16BIT_INT "unsigned short")
+ elseif(SIZEOF_UNSIGNED_INT EQUAL 2)
+ set(XERCES_U16BIT_INT "unsigned int")
+ else()
+ message(FATAL_ERROR "Couldn't find an unsigned 16-bit type")
+ endif()
+
+ if(SIZEOF_SIGNED_INT EQUAL 4)
+ set(XERCES_S32BIT_INT "signed int")
+ elseif(SIZEOF_SIGNED_LONG EQUAL 4)
+ set(XERCES_S32BIT_INT "signed long")
+ else()
+ message(FATAL_ERROR "Couldn't find a signed 32-bit type")
+ endif()
+
+ if(SIZEOF_UNSIGNED_INT EQUAL 4)
+ set(XERCES_U32BIT_INT "unsigned int")
+ elseif(SIZEOF_UNSIGNED_LONG EQUAL 4)
+ set(XERCES_U32BIT_INT "unsigned long")
+ else()
+ message(FATAL_ERROR "Couldn't find an unsigned 32-bit type")
+ endif()
+
+ if(SIZEOF_INT EQUAL 8)
+ set(XERCES_S64BIT_INT "int")
+ elseif(SIZEOF_LONG EQUAL 8)
+ set(XERCES_S64BIT_INT "long")
+ elseif(SIZEOF_LONG_LONG EQUAL 8)
+ set(XERCES_S64BIT_INT "long long")
+ elseif(SIZEOF___INT64 EQUAL 8)
+ set(XERCES_S64BIT_INT "__int64")
+ else()
+ message(FATAL_ERROR "Couldn't find a signed 64-bit type")
+ endif()
+
+ if(SIZEOF_UNSIGNED_INT EQUAL 8)
+ set(XERCES_U64BIT_INT "unsigned int")
+ elseif(SIZEOF_UNSIGNED_LONG EQUAL 8)
+ set(XERCES_U64BIT_INT "unsigned long")
+ elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL 8)
+ set(XERCES_U64BIT_INT "unsigned long long")
+ elseif(SIZEOF_UNSIGNED__INT64 EQUAL 8)
+ set(XERCES_U64BIT_INT "unsigned __int64")
+ else()
+ message(FATAL_ERROR "Couldn't find an unsigned 64-bit type")
+ endif()
+endif()
Added: xerces/c/trunk/cmake/XercesLFS.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesLFS.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesLFS.cmake (added)
+++ xerces/c/trunk/cmake/XercesLFS.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,27 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Large file support
+
+if (UNIX)
+ # This might not catch every possibility catered for by
+ # AC_SYS_LARGEFILE.
+ add_definitions(-D_FILE_OFFSET_BITS=64)
+ set(FILE_OFFSET_BITS 64)
+endif()
Added: xerces/c/trunk/cmake/XercesLString.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesLString.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesLString.cmake (added)
+++ xerces/c/trunk/cmake/XercesLString.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,31 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Wide string literals
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+int main() {
+ const wchar_t* s=L\"wide string\";
+ return 0;
+}"
+ HAVE_LSTRING)
+
+set(XERCES_LSTRSUPPORT ${HAVE_LSTRING})
Added: xerces/c/trunk/cmake/XercesMsgLoaderSelection.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesMsgLoaderSelection.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesMsgLoaderSelection.cmake (added)
+++ xerces/c/trunk/cmake/XercesMsgLoaderSelection.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,63 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# message loader selection
+
+# message loaders in order of preference
+list(APPEND msgloaders inmemory)
+
+if(ICU_FOUND)
+ list(APPEND msgloaders icu)
+endif()
+
+include(CheckIncludeFileCXX)
+include(CheckFunctionExists)
+check_include_file_cxx(nl_types.h HAVE_NLTYPES_H)
+check_function_exists(catopen HAVE_CATOPEN)
+check_function_exists(catclose HAVE_CATCLOSE)
+check_function_exists(catgets HAVE_CATGETS)
+if(HAVE_NLTYPES_H AND HAVE_CATOPEN AND HAVE_CATCLOSE AND HAVE_CATGETS)
+ set(iconv_available 1)
+endif()
+if(iconv_available)
+ list(APPEND msgloaders iconv)
+endif()
+
+string(REPLACE ";" "|" msgloader_help "${msgloaders}")
+list(GET msgloaders 0 xerces_msgloader_default)
+set(message-loader "${xerces_msgloader_default}" CACHE STRING "Message loader
(${msgloader_help})")
+set(msgloader "${message-loader}")
+
+list(FIND msgloaders "${msgloader}" msgloader_found)
+if(msgloader_found EQUAL -1)
+ message(FATAL_ERROR "${msgloader} message loader unavailable")
+endif()
+
+set(XERCES_USE_MSGLOADER_ICU 0)
+set(XERCES_USE_MSGLOADER_ICONV 0)
+set(XERCES_USE_MSGLOADER_INMEMORY 0)
+if(msgloader STREQUAL "icu")
+ set(XERCES_USE_MSGLOADER_ICU 1)
+elseif(msgloader STREQUAL "iconv")
+ set(XERCES_USE_MSGLOADER_ICONV 1)
+elseif(msgloader STREQUAL "inmemory")
+ set(XERCES_USE_MSGLOADER_INMEMORY 1)
+else()
+ message(FATAL_ERROR "Invalid message loader: \"${msgloader}\"")
+endif()
Added: xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake (added)
+++ xerces/c/trunk/cmake/XercesMutexMgrSelection.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,61 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# mutexmgr selection
+
+option(threads "Threading support" ON)
+
+if(threads)
+ find_package(Threads)
+
+ if(TARGET Threads::Threads)
+ if(WIN32)
+ list(APPEND mutexmgrs windows)
+ else()
+ list(APPEND mutexmgrs POSIX)
+ set(HAVE_PTHREAD 1)
+ endif()
+ endif()
+else()
+ set(mutexmgr nothreads)
+endif(threads)
+list(APPEND mutexmgrs nothreads)
+
+string(REPLACE ";" "|" mutexmgr_help "${mutexmgrs}")
+list(GET mutexmgrs 0 xerces_mutexmgr_default)
+set(mutex-manager "${xerces_mutexmgr_default}" CACHE STRING "Mutex manager
(${mutexmgr_help})")
+set(mutexmgr "${mutex-manager}")
+
+list(FIND mutexmgrs "${mutexmgr}" mutexmgr_found)
+if(mutexmgr_found EQUAL -1)
+ message(FATAL_ERROR "${mutexmgr} mutexmgr unavailable")
+endif()
+
+set(XERCES_USE_MUTEXMGR_POSIX 0)
+set(XERCES_USE_MUTEXMGR_WINDOWS 0)
+set(XERCES_USE_MUTEXMGR_NOTHREADS 0)
+if(mutexmgr STREQUAL "POSIX")
+ set(XERCES_USE_MUTEXMGR_POSIX 1)
+elseif(mutexmgr STREQUAL "windows")
+ set(XERCES_USE_MUTEXMGR_WINDOWS 1)
+elseif(mutexmgr STREQUAL "nothreads")
+ set(XERCES_USE_MUTEXMGR_NOTHREADS 1)
+else()
+ message(FATAL_ERROR "Invalid mutex manager: \"${mutexmgr}\"")
+endif()
Added: xerces/c/trunk/cmake/XercesNamespaces.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesNamespaces.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesNamespaces.cmake (added)
+++ xerces/c/trunk/cmake/XercesNamespaces.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,37 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# namespace keyword
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+namespace Outer {
+ namespace Inner {
+ int i = 0;
+ }
+}
+
+int main() {
+ using namespace Outer::Inner;
+ return i;
+}"
+ HAVE_NAMESPACES)
+
+set(XERCES_HAS_CPP_NAMESPACE ${HAVE_NAMESPACES})
Added: xerces/c/trunk/cmake/XercesNetAccessorSelection.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesNetAccessorSelection.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesNetAccessorSelection.cmake (added)
+++ xerces/c/trunk/cmake/XercesNetAccessorSelection.cmake Sat Jun 3 21:43:04
2017
@@ -0,0 +1,96 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# netaccessor selection
+
+option(network "Network support" ON)
+
+if(network)
+ find_library(SOCKET_LIBRARY socket)
+ find_library(NSL_LIBRARY nsl)
+
+ # netaccessors in order of preference
+
+ # CURL
+
+ # Requires select() which is UNIX only
+ if(UNIX)
+ find_package(CURL COMPONENTS uc data)
+ if(CURL_FOUND)
+ list(APPEND netaccessors curl)
+ endif()
+ endif()
+
+ # Windows
+
+ if(WIN32)
+ check_include_file_cxx(winsock2.h HAVE_WINSOCK2_H)
+ if(HAVE_WINSOCK2_H)
+ set(winsock_available 1)
+ list(APPEND netaccessors winsock)
+ endif()
+ endif()
+
+ # socket
+
+ check_include_file_cxx(sys/socket.h HAVE_SYS_SOCKET_H)
+ if(HAVE_SYS_SOCKET_H)
+ list(APPEND netaccessors socket)
+ endif()
+
+ # MacOS X CFURL
+
+ set(cfurl_available 0)
+ if(CMAKE_HOST_APPLE)
+ check_include_file_cxx(CoreServices/CoreServices.h
HAVE_CORESERVICES_CORESERVICES_H)
+ find_library(CORE_SERVICES_LIBRARY CoreServices )
+ if (HAVE_CORESERVICES_CORESERVICES_H AND CORE_SERVICES_LIBRARY)
+ list(APPEND netaccessors cfurl)
+ set(cfurl 1)
+ endif()
+ endif()
+
+ string(REPLACE ";" "|" netaccessor_help "${netaccessors}")
+ list(GET netaccessors 0 xerces_netaccessor_default)
+ set(network-accessor "${xerces_netaccessor_default}" CACHE STRING "Network
accessor (${netaccessor_help})")
+ set(netaccessor "${network-accessor}")
+
+ list(FIND netaccessors "${netaccessor}" netaccessor_found)
+ if(netaccessor_found EQUAL -1)
+ message(FATAL_ERROR "${netaccessor} netaccessor unavailable")
+ endif()
+
+ set(XERCES_USE_NETACCESSOR_CURL 0)
+ set(XERCES_USE_NETACCESSOR_SOCKET 0)
+ set(XERCES_USE_NETACCESSOR_CFURL 0)
+ set(XERCES_USE_NETACCESSOR_WINSOCK 0)
+ if(netaccessor STREQUAL "curl")
+ set(XERCES_USE_NETACCESSOR_CURL 1)
+ elseif(netaccessor STREQUAL "socket")
+ set(XERCES_USE_NETACCESSOR_SOCKET 1)
+ elseif(netaccessor STREQUAL "cfurl")
+ set(XERCES_USE_NETACCESSOR_CFURL 1)
+ elseif(netaccessor STREQUAL "winsock")
+ set(XERCES_USE_NETACCESSOR_WINSOCK 1)
+ else()
+ message(FATAL_ERROR "Invalid netaccessor: \"${netaccessor}\"")
+ endif()
+else()
+ set(netaccessor OFF)
+endif(network)
Added: xerces/c/trunk/cmake/XercesOperatorDelete.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesOperatorDelete.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesOperatorDelete.cmake (added)
+++ xerces/c/trunk/cmake/XercesOperatorDelete.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,43 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Check whether the compiler chokes on a placement operator delete
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+#include <stdlib.h>
+
+class XMemory {
+public:
+ void* operator new(size_t s) { return 0; }
+ void* operator new(size_t s, void* ptr) { return 0; }
+ void operator delete(void* p) {}
+ void operator delete(void* p, void* ptr) {}
+};
+
+int main() {
+ return 0;
+}"
+ CXX_matching-delete-operator)
+
+set(XERCES_NO_MATCHING_DELETE_OPERATOR 0)
+if(NOT CXX_matching-delete-operator)
+ set(XERCES_NO_MATCHING_DELETE_OPERATOR 1)
+endif()
Added: xerces/c/trunk/cmake/XercesPathDelimiters.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesPathDelimiters.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesPathDelimiters.cmake (added)
+++ xerces/c/trunk/cmake/XercesPathDelimiters.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,35 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# path delimiters
+
+set(path_delims /)
+
+set(xerces_path_delimiter_backslash_default OFF)
+if(WIN32)
+ set(xerces_path_delimiter_backslash_default ON)
+endif()
+
+option(path-delimiter-backslash "Accept backslash as a path delimiter"
${xerces_path_delimiter_backslash_default})
+
+set(XERCES_PATH_DELIMITER_BACKSLASH 0)
+if(path-delimiter-backslash)
+ set(path_delims "${path_delims}\\")
+ set(XERCES_PATH_DELIMITER_BACKSLASH 1)
+endif()
Added: xerces/c/trunk/cmake/XercesPathMax.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesPathMax.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesPathMax.cmake (added)
+++ xerces/c/trunk/cmake/XercesPathMax.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,30 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# PATH_MAX
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+#include <limits.h>
+int main(void) {
+ char dummy[PATH_MAX];
+ return 0;
+}"
+ HAVE_PATH_MAX)
Added: xerces/c/trunk/cmake/XercesSSE2.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesSSE2.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesSSE2.cmake (added)
+++ xerces/c/trunk/cmake/XercesSSE2.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,103 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# SSE2 support
+
+include(CheckCXXSourceCompiles)
+
+option(sse2 "SSE2 support" ON)
+if(sse2)
+ set(CMAKE_CXX_FLAGS_SAVE "${CMAKE_CXX_FLAGS}")
+ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_CXX_FLAGS_SAVE "${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+ check_cxx_source_compiles("
+#include <emmintrin.h>
+
+int main() {
+ __m128i one;
+ return 0;
+}"
+ CXX_NEEDS_msse2)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
+ if(CXX_NEEDS_msse2)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
+ endif()
+ endif()
+
+ check_cxx_source_compiles("
+#include <intrin.h>
+
+int main() {
+ return 0;
+}"
+ XERCES_HAVE_INTRIN_H)
+ check_cxx_source_compiles("
+#include <emmintrin.h>
+
+int main() {
+ return 0;
+}"
+ XERCES_HAVE_EMMINTRIN_H)
+ check_cxx_source_compiles("
+#include <cpuid.h>
+
+int main() {
+ return 0;
+}"
+ HAVE_CPUID_H)
+ check_cxx_source_compiles("
+#include <intrin.h>
+
+int main() {
+ int CPUInfo[4];
+ __cpuid(CPUInfo, 1);
+ return 0;
+}"
+ XERCES_HAVE_CPUID_INTRINSIC)
+ check_cxx_source_compiles("
+#include <cpuid.h>
+
+int main() {
+ unsigned int eax, ebx, ecx, edx;
+ __get_cpuid (1, &eax, &ebx, &ecx, &edx);
+ return 0;
+}"
+ XERCES_HAVE_GETCPUID)
+ check_cxx_source_compiles("
+#include <emmintrin.h>
+
+int main() {
+ __m128i* one=(__m128i*)_mm_malloc(4, 16);
+ __m128i* two=(__m128i*)_mm_malloc(4, 16);
+ __m128i xmm1 = _mm_load_si128(one);
+ __m128i xmm2 = _mm_load_si128(two);
+ __m128i xmm3 = _mm_or_si128(xmm1, xmm2);
+ _mm_store_si128(one, xmm3);
+ _mm_free(one);
+ _mm_free(two);
+ return 0;
+}"
+ XERCES_HAVE_SSE2_INTRINSIC)
+
+ # SSE2 not functional; restore flags
+ if(NOT XERCES_HAVE_SSE2_INTRINSIC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
+ endif()
+endif()
Added: xerces/c/trunk/cmake/XercesStdLibs.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesStdLibs.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesStdLibs.cmake (added)
+++ xerces/c/trunk/cmake/XercesStdLibs.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,45 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# C++ standard library includes
+
+include(CheckCXXSourceCompiles)
+include(XercesNamespaces)
+
+set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
+if(HAVE_NAMESPACES)
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-DHAVE_NAMESPACES)
+endif()
+
+check_cxx_source_compiles("
+#include <map>
+#include <iomanip>
+#include <cmath>
+#ifdef HAVE_NAMESPACES
+using namespace std;
+#endif
+
+int main() {
+ return 0;
+}"
+ HAVE_STD_LIBS)
+
+set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
+
+set(XERCES_NEW_IOSTREAMS ${HAVE_STD_LIBS})
Added: xerces/c/trunk/cmake/XercesStdNamespace.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesStdNamespace.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesStdNamespace.cmake (added)
+++ xerces/c/trunk/cmake/XercesStdNamespace.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,33 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# C++ standard library std:: namespace
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+#include <iostream>
+std::istream& is = std::cin;
+
+int main() {
+ return 0;
+}"
+ HAVE_STD_NAMESPACE)
+
+set(XERCES_STD_NAMESPACE ${HAVE_STD_NAMESPACE})
Added: xerces/c/trunk/cmake/XercesTest.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesTest.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesTest.cmake (added)
+++ xerces/c/trunk/cmake/XercesTest.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,80 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# test macros
+
+find_program(DIFF_EXECUTABLE diff)
+
+set(xerces_test_dir "${CMAKE_CURRENT_LIST_DIR}")
+
+macro(add_generic_xerces_test name)
+ set(options EXPECT_FAIL)
+ set(oneValueArgs WORKING_DIRECTORY OBSERVED_DIR EXPECTED_DIR STDIN)
+ set(multiValueArgs COMMAND)
+ cmake_parse_arguments(AXT "${options}" "${oneValueArgs}"
+ "${multiValueArgs}" ${ARGN})
+
+ list(GET AXT_COMMAND 0 command)
+ list(REMOVE_AT AXT_COMMAND 0)
+
+ if(NOT AXT_WORKING_DIRECTORY)
+ set(AXT_WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/samples/data")
+ endif()
+
+ unset(xerces_test_extra_args)
+ if(WIN32)
+ list(APPEND xerces_test_extra_args "-DWIN32=${WIN32}")
+ endif()
+ if(CYGWIN)
+ list(APPEND xerces_test_extra_args "-DCYGWIN=${CYGWIN}")
+ endif()
+
+ add_test(NAME "${name}"
+ COMMAND "${CMAKE_COMMAND}"
+ "-DNAME=${name}"
+ "-DPROGRAM=$<TARGET_FILE:${command}>"
+ "-DARGS=${AXT_COMMAND}"
+ "-DLIBXERCES_C=$<TARGET_FILE:xerces-c>"
+ "-DWORKDIR=${AXT_WORKING_DIRECTORY}"
+ "-DSTDIN=${AXT_STDIN}"
+ "-DEXPECT_FAIL=${AXT_EXPECT_FAIL}"
+ "-DOBSERVED_DIR=${CMAKE_CURRENT_BINARY_DIR}/observed"
+ "-DEXPECTED_DIR=${CMAKE_CURRENT_SOURCE_DIR}/expected"
+ "-DDIFF=${DIFF_EXECUTABLE}"
+ "-DNLS_HOME=${PROJECT_BINARY_DIR}/src"
+ ${xerces_test_extra_args}
+ -P "${xerces_test_dir}/RunTest.cmake"
+ )
+endmacro()
+
+macro(add_xerces_test name)
+ add_generic_xerces_test(
+ ${name}
+ OBSERVED_DIR "${PROJECT_BINARY_DIR}/tests/observed"
+ EXPECTED_DIR "${PROJECT_SOURCE_DIR}/tests/expected"
+ ${ARGN})
+endmacro()
+
+macro(add_xerces_sample_test name)
+ add_generic_xerces_test(
+ ${name}
+ OBSERVED_DIR "${PROJECT_BINARY_DIR}/samples/observed"
+ EXPECTED_DIR "${PROJECT_SOURCE_DIR}/samples/expected"
+ ${ARGN})
+endmacro()
Added: xerces/c/trunk/cmake/XercesTranscoderSelection.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesTranscoderSelection.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesTranscoderSelection.cmake (added)
+++ xerces/c/trunk/cmake/XercesTranscoderSelection.cmake Sat Jun 3 21:43:04
2017
@@ -0,0 +1,117 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# transcoder selection
+
+# transcoders in order of preference
+
+# ICU
+
+if(ICU_FOUND)
+ list(APPEND transcoders icu)
+endif()
+
+# MacOS
+
+set(macosunicodeconverter_available 0)
+if(CMAKE_HOST_APPLE)
+ check_include_file_cxx(CoreServices/CoreServices.h
HAVE_CORESERVICES_CORESERVICES_H)
+ find_library(CORE_SERVICES_LIBRARY CoreServices )
+ if (HAVE_CORESERVICES_CORESERVICES_H AND CORE_SERVICES_LIBRARY)
+ list(APPEND transcoders macosunicodeconverter)
+ set(macosunicodeconverter_available 1)
+ endif()
+endif()
+
+# GNU iconv
+
+check_include_file_cxx(iconv.h HAVE_ICONV_H)
+check_include_file_cxx(wchar.h HAVE_WCHAR_H)
+check_include_file_cxx(string.h HAVE_STRING_H)
+check_include_file_cxx(stdlib.h HAVE_STDLIB_H)
+check_include_file_cxx(stdio.h HAVE_STDIO_H)
+check_include_file_cxx(ctype.h HAVE_CTYPE_H)
+check_include_file_cxx(locale.h HAVE_LOCALE_H)
+check_include_file_cxx(errno.h HAVE_ERRNO_H)
+check_include_file_cxx(endian.h HAVE_ENDIAN_H)
+check_include_file_cxx(machine/endian.h HAVE_MACHINE_ENDIAN_H)
+check_include_file_cxx(arpa/nameser_compat.h HAVE_ARPA_NAMESER_COMPAT_H)
+check_function_exists(iconv_open HAVE_ICONV_OPEN)
+check_function_exists(iconv_close HAVE_ICONV_CLOSE)
+check_function_exists(iconv HAVE_ICONV)
+
+set(gnuiconv_available 0)
+if(HAVE_ICONV_H AND HAVE_WCHAR_H AND HAVE_STRING_H AND HAVE_STDLIB_H AND
+ HAVE_STDIO_H AND HAVE_CTYPE_H AND HAVE_LOCALE_H AND HAVE_ERRNO_H)
+ if (HAVE_ENDIAN_H OR HAVE_MACHINE/ENDIAN_H OR HAVE_ARPA/NAMESER_COMPAT_H)
+ if(HAVE_ICONV_OPEN AND HAVE_ICONV_CLOSE AND HAVE_ICONV)
+ set(gnuiconv_available 1)
+ list(APPEND transcoders gnuiconv)
+ endif()
+ endif()
+endif()
+
+# Windows
+
+if(WIN32)
+ set(windows_available 1)
+ list(APPEND transcoders windows)
+endif()
+
+# iconv
+
+check_include_file_cxx(wchar.h HAVE_WCHAR_H)
+check_function_exists(mblen HAVE_MBLEN)
+check_function_exists(wcstombs HAVE_WCSTOMBS)
+check_function_exists(mbstowcs HAVE_MBSTOWCS)
+
+set(iconv_available 0)
+if(HAVE_WCHAR_H AND HAVE_MBLEN AND HAVE_WCSTOMBS AND HAVE_MBSTOWCS)
+ set(iconv_available 1)
+ list(APPEND transcoders iconv)
+endif()
+
+string(REPLACE ";" "|" transcoder_help "${transcoders}")
+list(GET transcoders 0 xerces_transcoder_default)
+set(transcoder "${xerces_transcoder_default}" CACHE STRING "Transcoder
(${transcoder_help})")
+set(transcoder "${transcoder}")
+
+list(FIND transcoders "${transcoder}" transcoder_found)
+if(transcoder_found EQUAL -1)
+ message(FATAL_ERROR "${transcoder} transcoder unavailable")
+endif()
+
+set(XERCES_USE_TRANSCODER_ICU 0)
+set(XERCES_USE_TRANSCODER_ICONV 0)
+set(XERCES_USE_TRANSCODER_GNUICONV 0)
+set(XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER 0)
+set(XERCES_USE_TRANSCODER_WINDOWS 0)
+if(transcoder STREQUAL "icu")
+ set(XERCES_USE_TRANSCODER_ICU 1)
+elseif(transcoder STREQUAL "iconv")
+ set(XERCES_USE_TRANSCODER_ICONV 1)
+elseif(transcoder STREQUAL "gnuiconv")
+ set(XERCES_USE_TRANSCODER_GNUICONV 1)
+elseif(transcoder STREQUAL "macosunicodeconverter")
+ set(XERCES_USE_TRANSCODER_MACOSUNICODECONVERTER 1)
+elseif(transcoder STREQUAL "windows")
+ set(XERCES_USE_TRANSCODER_WINDOWS 1)
+else()
+ message(FATAL_ERROR "Invalid transcoder: \"${transcoder}\"")
+endif()
Added: xerces/c/trunk/cmake/XercesVolatile.cmake
URL:
http://svn.apache.org/viewvc/xerces/c/trunk/cmake/XercesVolatile.cmake?rev=1797546&view=auto
==============================================================================
--- xerces/c/trunk/cmake/XercesVolatile.cmake (added)
+++ xerces/c/trunk/cmake/XercesVolatile.cmake Sat Jun 3 21:43:04 2017
@@ -0,0 +1,29 @@
+# CMake build for xerces-c
+#
+# Written by Roger Leigh <[email protected]>
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# volatile keyword
+
+include(CheckCXXSourceCompiles)
+
+check_cxx_source_compiles("
+int main() {
+ volatile int i = 1;
+ return 0;
+}"
+ HAVE_VOLATILE)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]