[
https://issues.apache.org/jira/browse/XERCESC-2077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Roger Leigh updated XERCESC-2077:
-
Attachment: 0002-cmake-Align-versioning-with-Autotools-and-Visual-Stu.patch
Update to fix library versioning on Windows and Unix to retain full backward
compatibility.
> Add CMake build system
> --
>
> Key: XERCESC-2077
> URL: https://issues.apache.org/jira/browse/XERCESC-2077
> Project: Xerces-C++
> Issue Type: New Feature
> Components: Build
>Affects Versions: 3.1.4
> Environment: All
>Reporter: Roger Leigh
> Labels: build, cmake, patch
> Attachments: 0001-cmake-Add-CMake-build-system.patch,
> 0001-cmake-Add-CMake-build-system-trunk.patch,
> 0002-cmake-Align-versioning-with-Autotools-and-Visual-Stu.patch,
> screenshot-xerces-ci-tests-trunk.png
>
>
> h4. Introduction
> The attached patch implements a CMake build for Xerces-C++.
> I have spent significant effort performing a "comprehensive" conversion of
> the existing GNU autotools and MSVC project file logic to a unified CMake
> build which supports all platforms with a single set of build files, as well
> as testing it exhaustively (see below). The existing GNU autotools build and
> MSVC project builds will continue to function and are unaffected by this
> addition.
> h5. References
> - http://mail-archives.apache.org/mod_mbox/xerces-c-dev/201302.mbox/browser
> - http://mail-archives.apache.org/mod_mbox/xerces-c-dev/201506.mbox/browser
> - https://github.com/rleigh-codelibre/xerces-c/tree/cmake-3.1
> h4. Background
> CMake is a meta-build system which generates the build files for a specified
> build system, such as make, Visual Studio msbuild, nmake, ninja or a number
> of other build tools and IDEs. This allows Xerces-C++ to be built on any
> supported platform with the native tools for that platform.
> The reason why I originally needed this was due to the large maintenance
> burden of patching the provided Visual Studio project files, both for fixing
> bugs in those files and in being able to support versions of Visual Studio
> which aren't yet supported by the provided project files or for unsupported
> configurations e.g. Clang/C2, other platforms etc. The lack of an install
> target also meant that to integrate this with a larger build required
> manually copying bits out of the build tree. The cost of debugging and
> patching the existing project files for use in our CI builds was getting too
> great--maintaining and using this CMake build out of tree will be cheaper and
> more robust. However, given that other people have also requested such
> support in the past, I thought it might benefit others to have this merged
> upstream so that it would be available to the benefit of all.
> I have done a direct conversion of every autoconf option and feature test.
> Where there wasn't a direct CMake equivalent, I've written each feature test
> to exactly match the autoconf behaviour. The automake Makefile.am logic is
> directly represented in the corresponding CMakeLists.txt files. Broadly:
> ||Autotools||CMake||
> |{{configure.ac}}, {{Makefile.am}}|{{CMakeLists.txt}}|
> |{{*/Makefile.am}}|{{*/CMakeLists.txt}}|
> |{{m4/*}}|{{cmake/*}}|
> |{{src/xercesc/util/Xerces_autoconf_config.hpp.in}}|{{src/xercesc/util/Xerces_autoconf_config.hpp.cmake.in}}|
> |_autoheader_|config.h.cmake.in|
> |{{tools/createdocs.sh}}|{{CMakeLists.txt}} (custom target)|
> |{{scripts/sanityTest.pl}}|{{cmake/XercesTest.cmake}} (direct support)|
> |{{scripts/sanityTest_ExpectedResult.log}}|{{test/expected/\*}},
> {{samples/expected/\*}} (individual log files)|
> And there's a section added to the documentation giving an overview of how to
> use it, in the same style as the autotools section.
> h5. Enhancements over the existing build systems
> - Universal build for any platform and build system supported by CMake
> - Full support for feature and library detection on Windows, including
> discovery of ICU libraries; it's no longer static, using (long broken)
> ICU configurations in the project files
> - An install target now exists on Windows, so the various pieces don't
> need manually copying out of the build tree
> - Parallel build speed improvements when using ninja to replace make
> or msbuild; the speedup with the latter is significant
> - Export of CMake configuration in addition to pkg-config, to make
> Xerces-C++ integrate with downstream projects using Xerces-C++ and
> cmake; this includes all dependency information of the libraries
> Xerces was linked with, i.e. transitive dependencies.
> - Installs the HTML documentation
> - Targets are provided for regenerating the documentation (docs and
> apidocs)
> - Documentation can be edited and rebuilt from within Visual Studio
> - Unit tests can be run on