jsoncpp: Build the library within CMake

Update json/json.h to account for our lack of autolink.h.  Update
json/config.h to include KWSys Large File Support configuration so that
consistent stream libraries are used (on AIX with XL).

Add a cm_jsoncpp_reader.h header to include the CMake-provided copy of
the json/reader.h header from CMake sources.
This commit is contained in:
Brad King 2015-01-13 10:45:04 -05:00
parent 84d5674d4e
commit 1fc556536e
5 changed files with 43 additions and 1 deletions

View File

@ -371,6 +371,11 @@ macro (CMAKE_BUILD_UTILITIES)
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
endif()
#---------------------------------------------------------------------
# Build jsoncpp library.
add_subdirectory(Utilities/cmjsoncpp)
CMAKE_SET_TARGET_FOLDER(cmjsoncpp "Utilities/3rdParty")
#---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest.
if(CTEST_USE_XMLRPC)

View File

@ -0,0 +1,18 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2015 Kitware, Inc., Insight Software Consortium
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.
============================================================================*/
#ifndef cm_jsoncpp_reader_h
#define cm_jsoncpp_reader_h
/* Use the jsoncpp library configured for CMake. */
#include <cmjsoncpp/include/json/reader.h>
#endif

View File

@ -0,0 +1,17 @@
project(JsonCpp CXX)
set(JSONCPP_SOURCES
src/lib_json/json_batchallocator.h
src/lib_json/json_reader.cpp
src/lib_json/json_tool.h
src/lib_json/json_value.cpp
src/lib_json/json_valueiterator.inl
src/lib_json/json_writer.cpp
)
include_directories(
${JsonCpp_SOURCE_DIR}/include
${KWSYS_HEADER_ROOT}
)
add_library(cmjsoncpp ${JSONCPP_SOURCES})

View File

@ -6,6 +6,9 @@
#ifndef JSON_CONFIG_H_INCLUDED
#define JSON_CONFIG_H_INCLUDED
// Include KWSys Large File Support configuration.
#include <cmsys/Configure.h>
/// If defined, indicates that json library is embedded in CppTL library.
//# define JSON_IN_CPPTL 1

View File

@ -6,7 +6,6 @@
#ifndef JSON_JSON_H_INCLUDED
#define JSON_JSON_H_INCLUDED
#include "autolink.h"
#include "value.h"
#include "reader.h"
#include "writer.h"