Commit 89d256d1 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell Committed by Code Review
Browse files

Merge topic 'jsoncpp-system-option' into master

6c18d39e Allow JsonCpp to be VTK or system supplied
parents 0e21b528 6c18d39e
# Find the JsonCpp include files and library.
#
# JsonCpp is a C++ library that can read/write JSON (JavaScript Object Notation)
# documents. See http://jsoncpp.sourceforge.net/ for more details.
#
# This module defines:
# JsonCpp_INCLUDE_DIRS - where to find json/json.h
# JsonCpp_LIBRARIES - the libraries to link against to use JsonCpp
# JsonCpp_FOUND - if false the library was not found.
find_path(JsonCpp_INCLUDE_DIR "json/json.h"
PATH_SUFFIXES "jsoncpp"
DOC "Specify the JsonCpp include directory here")
find_library(JsonCpp_LIBRARY
NAMES jsoncpp
PATHS
DOC "Specify the JsonCpp library here")
set(JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR})
set(JsonCpp_LIBRARIES "${JsonCpp_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JsonCpp DEFAULT_MSG
JsonCpp_LIBRARIES JsonCpp_INCLUDE_DIRS)
mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
......@@ -28,11 +28,7 @@
#include <vector>
#include <string>
// Needed for Windows declspec import logic
#if defined(WIN32) && defined(VTK_BUILD_SHARED_LIBS)
# define JSON_DLL
#endif
#include <json/json.h>
#include "vtk_jsoncpp.h"
#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember))
......@@ -363,7 +359,7 @@ int vtkPlot3DMetaReader::RequestInformation(
{
// report to the user the failure and their locations in the document.
vtkErrorMacro("Failed to parse configuration\n"
<< reader.getFormattedErrorMessages().c_str());
<< reader.getFormatedErrorMessages().c_str());
return 0;
}
......
project(JSONCPP)
set(vtkjsoncpp_THIRD_PARTY 1)
set(vtkjsoncpp_LIBRARIES vtkjsoncpp)
vtk_module_export_info()
if(VTK_REQUIRE_LARGE_FILE_SUPPORT)
add_definitions(
-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_LARGE_FILES
-D_FILE_OFFSET_BITS=64
)
endif()
set(JSONCPP_SOURCES
jsoncpp.cpp
)
include_directories(${JSONCPP_SOURCE_DIR} ${JSONCPP_BINARY_DIR})
if (BUILD_SHARED_LIBS AND WIN32)
add_definitions(-DJSON_DLL_BUILD)
endif()
vtk_add_library(vtkjsoncpp ${JSONCPP_SOURCES})
if(NOT VTK_INSTALL_NO_DEVELOPMENT)
install(DIRECTORY
${JSONCPP_SOURCE_DIR}/json
DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/JSONCPP
COMPONENT Development)
endif()
vtk_module_third_party(JsonCpp)
/*=========================================================================
Program: Visualization Toolkit
Module: vtk_jsoncpp.h.in
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef __vtk_jsoncpp_h
#define __vtk_jsoncpp_h
/* Use the JsonCpp library configured for VTK. */
#cmakedefine VTK_USE_SYSTEM_JSONCPP
#ifdef VTK_USE_SYSTEM_JSONCPP
# include <json/json.h>
# ifndef JSON_FORWARDS_H_INCLUDED
# error Incorrect header included, check your include paths for conflicts
# endif
#else
// Needed for Windows declspec import logic
# if defined(_WIN32) && defined(VTK_BUILD_SHARED_LIBS)
# define JSON_DLL
# endif
# include <vtkjsoncpp/json/json.h>
#endif
#endif
project(JsonCpp)
set(vtkjsoncpp_THIRD_PARTY 1)
set(vtkjsoncpp_LIBRARIES vtkjsoncpp)
vtk_module_export_info()
if(VTK_REQUIRE_LARGE_FILE_SUPPORT)
add_definitions(
-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_LARGE_FILES
-D_FILE_OFFSET_BITS=64
)
endif()
set(JSONCPP_SOURCES
jsoncpp.cpp
)
include_directories(${JSONCPP_SOURCE_DIR} ${JSONCPP_BINARY_DIR})
if(BUILD_SHARED_LIBS AND WIN32)
add_definitions(-DJSON_DLL_BUILD)
endif()
vtk_add_library(vtkjsoncpp ${JSONCPP_SOURCES})
if(NOT VTK_INSTALL_NO_DEVELOPMENT)
install(DIRECTORY
${JSONCPP_SOURCE_DIR}/json
DESTINATION ${VTK_INSTALL_INCLUDE_DIR}/vtkjsoncpp
COMPONENT Development)
endif()
......@@ -1510,7 +1510,7 @@ namespace Json {
* during parsing.
* deprecated: Use getFormattedErrorMessages() instead (typo fix).
*/
JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead")
//JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead")
std::string getFormatedErrorMessages() const;
/** \brief Returns a user friendly string that list errors in the parsed document.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment