Plus some other build-related changes. I don't think there is anything
functionally different from 1.7.7, or even any binary incompatibilities, but
the cmake change is significant.
* The GNUInstallDirs module is more idiomatic and supported by
Kitware upstream, whereas the current directories are not
standardised across CMake-using packages. Using CMake native
mechanisms is better than reinventing the wheel, as it makes
using the build system more uniform across the ecosystem
* Use CMAKE_CXX_STANDARD to force C++11
* Require CMake 3.1.0 at a minimum
* Fixed lower/UPPERcase format for function/macro calls
* Fixed indents by replacing tabs with 4 spaces
- if building as a submodule of another repository, installation of pkg-config files can fail because they may not be in the top-level binary directory
- changing ${CMAKE_BINARY_DIR} to ${CMAKE_CURRENT_BINARY_DIR} allow CMake to find the files for installation
'-pedantic' issues all warnings demanded by strict ISO C/C++; rejecting
extensions that do not follow ISO C/C++. Without this option, certain GNU
extensions and traditional C/C++ features are supported as well.
With this option enabled building jsoncpp fails with the musl toolchain on
x86 because of an incompatible posix_memalign declaration [1]. Without
'-pedantic' there is no error anymore and jsoncpp builds fine.
Add an option JSONCPP_WITH_STRICT_ISO to disable compilation with '-pedantic'
with GCC. If jsoncpp is build with the JSONCPP_WITH_WARNING_AS_ERROR option
'-pedantic-errors' is used instead.
[1] https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01425.html
* Clean up closing statements for if conditions, functions, macros,
and other entities. Newer versions of CMake do not require you to
redundantly respecify the parameters to the opening arguments.
-Werror shouldn't be used in released code since it can cause random build
failures on moderate warnings. It also depends on the used toolchain since
different toolchains may or may not print the same warnings.
Do not prepend ${prefix} to substituted includedir & libdir
in the pkg-config file -- if the paths are overriden by user, CMake puts
absolute paths there (even if user specifies a relative path). Instead,
use the absolute path provided by CMake and appropriately default
LIBRARY_INSTALL_DIR & INCLUDE_INSTALL_DIR to absolute paths with
${CMAKE_INSTALL_PREFIX} prepended.
Fixes: https://github.com/open-source-parsers/jsoncpp/issues/279
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Currently JSONCPP_LIB_BUILD_SHARED variable is used as option to build static/shared libraries.
The current patch uses standard CMake variables for this.
Such a workaround is done in https://github.com/open-source-parsers/jsoncpp/issues/51
Current patch will make it generic.
This forces consistency, since they will be re-generated whenever
a git operation alters CMakelists.txt. They are still in the repo
because users might not actually run cmake.
To run these tests, in cmake build-dir:
make jsoncpp_check
TravisCI is now set to run these always.
For now, the test_json_lib unit-tests will still run.
issue #187
With set(CMAKE_*_OUTPUT_DIRECTORY) when using jsoncpp as a sub project,
the parent project's executables and libraries will also be outputed to
jsoncpp's directory. By removing this, it is up to the parent projects
to decide where to put their and jsoncpp's executables and libraries.
RPM-based distros such as Fedora or Mageia put 64bit libraries in /usr/lib64
while 32bit libraries go to /usr/lib. This is usually taken into account
in CMake projects using a LIB_SUFFIX parameter that can be set to "" or "64".
Igor Okulist and Damien Buhl (Patch #14). Added support for running
tests and building with DLL on Windows.
- added missing JSON_API
- Visual Studio DLL: suppressed warning "C4251: <data member>: <type>
needs to have dll-interface to be used by..." via pragma push/pop
in json-cpp headers.
- New header json/version.h now contains version number macros
(JSONCPP_VERSION_MAJOR, JSONCPP_VERSION_MINOR, JSONCPP_VERSION_PATCH
and JSONCPP_VERSION_HEXA). While this header is generated by CMake,
it is committed to ease build with alternate build system
(CMake only update the file when it changes avoid issues with VCS).