From 1fc556536e0c0475d401e8b5747b46e9f7c32287 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 13 Jan 2015 10:45:04 -0500 Subject: [PATCH] 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. --- CMakeLists.txt | 5 +++++ Utilities/cm_jsoncpp_reader.h | 18 ++++++++++++++++++ Utilities/cmjsoncpp/CMakeLists.txt | 17 +++++++++++++++++ Utilities/cmjsoncpp/include/json/config.h | 3 +++ Utilities/cmjsoncpp/include/json/json.h | 1 - 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Utilities/cm_jsoncpp_reader.h create mode 100644 Utilities/cmjsoncpp/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1812b2773..184760097 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Utilities/cm_jsoncpp_reader.h b/Utilities/cm_jsoncpp_reader.h new file mode 100644 index 000000000..d7cb50e7f --- /dev/null +++ b/Utilities/cm_jsoncpp_reader.h @@ -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 + +#endif diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt new file mode 100644 index 000000000..0ff8820f4 --- /dev/null +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -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}) diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h index afd3a4560..4d31797a4 100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h @@ -6,6 +6,9 @@ #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED +// Include KWSys Large File Support configuration. +#include + /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 diff --git a/Utilities/cmjsoncpp/include/json/json.h b/Utilities/cmjsoncpp/include/json/json.h index 8f10ac2bf..f89bc6270 100644 --- a/Utilities/cmjsoncpp/include/json/json.h +++ b/Utilities/cmjsoncpp/include/json/json.h @@ -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"