Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue-2295
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Apr 23, 2019
2 parents 9aae090 + 051f10e commit 136732f
Show file tree
Hide file tree
Showing 105 changed files with 23,687 additions and 9,997 deletions.
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ include(${PDAL_CMAKE_DIR}/lzma.cmake)
include(${PDAL_CMAKE_DIR}/zstd.cmake)
include(${PDAL_CMAKE_DIR}/test.cmake)
include(${PDAL_CMAKE_DIR}/ctest.cmake)
include(${PDAL_CMAKE_DIR}/json.cmake)
include(${PDAL_CMAKE_DIR}/libxml2.cmake)
include(${PDAL_CMAKE_DIR}/dimension.cmake)
include(${PDAL_CMAKE_DIR}/arbiter.cmake)
include(${PDAL_CMAKE_DIR}/nlohmann.cmake)
include(${PDAL_CMAKE_DIR}/openssl.cmake) # Optional

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -177,9 +177,6 @@ add_subdirectory(dimbuilder)
add_subdirectory(vendor/pdalboost)
add_subdirectory(vendor/arbiter)
add_subdirectory(vendor/kazhdan)
if (NOT PDAL_HAVE_JSONCPP)
add_subdirectory(vendor/jsoncpp/dist)
endif()
add_subdirectory(pdal/util)
add_subdirectory(tools)
add_subdirectory(apps)
Expand Down Expand Up @@ -256,9 +253,9 @@ target_include_directories(${PDAL_BASE_LIB_NAME}
${PDAL_VENDOR_DIR}
${PDAL_VENDOR_DIR}/eigen
${PDAL_VENDOR_DIR}/pdalboost
${PDAL_JSONCPP_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIR}
${ZSTD_INCLUDE_DIRS}
${NLOHMANN_INCLUDE_DIR}
PUBLIC
${GDAL_INCLUDE_DIR}
${LASZIP_INCLUDE_DIR}
Expand All @@ -278,7 +275,6 @@ target_link_libraries(${PDAL_BASE_LIB_NAME}
${PDAL_UTIL_LIB_NAME}
${PDAL_ARBITER_LIB_NAME}
${PDAL_KAZHDAN_LIB_NAME}
${PDAL_JSONCPP_LIB_NAME}
INTERFACE
${PDAL_LIBDIR}
)
Expand Down
3 changes: 1 addition & 2 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ target_link_libraries(${PDAL_APP}
PRIVATE
${PDAL_BASE_LIB_NAME}
${PDAL_UTIL_LIB_NAME}
${PDAL_JSONCPP_LIB_NAME}
${GDAL_LIBRARY}
${WINSOCK_LIBRARY}
)
target_include_directories(${PDAL_APP} PRIVATE
${PDAL_JSONCPP_INCLUDE_DIR}
${NLOHMANN_INCLUDE_DIR}
${PDAL_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${PROJECT_BINARY_DIR}/include)
Expand Down
50 changes: 27 additions & 23 deletions apps/pdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <string>
#include <vector>

#include <json/json.h>
#include <nlohmann/json.hpp>

#ifndef _WIN32
#include <csignal>
Expand Down Expand Up @@ -160,18 +160,19 @@ void App::outputDrivers()
}
else
{
Json::Value array(Json::arrayValue);
NL::json j;
for (auto name : stages)
{
std::string description = PluginManager<Stage>::description(name);
std::string link = PluginManager<Stage>::link(name);
Json::Value node(Json::objectValue);
node["name"] = name;
node["description"] = description;
node["link"] = link;
array.append(node);
j.push_back(
{ {"name", name},
{"description", description},
{"link", link}
}
);
}
m_out << array;
m_out << j;
}
}

Expand Down Expand Up @@ -217,15 +218,16 @@ void App::outputOptions(std::string const& stageName, std::ostream& strm)
{
std::ostringstream ostr;
args.dump3(ostr);
std::string json = ostr.str();

Json::Reader jsonReader;
Json::Value array;
Json::Value object(Json::objectValue);
jsonReader.parse(json, array);

object[stageName] = array;
NL::json array;
try
{
array = NL::json::parse(ostr.str());
}
catch (NL::json::parse_error)
{}

NL::json object = { stageName, array };
strm << object;
}
}
Expand All @@ -248,17 +250,19 @@ void App::outputOptions()
}
else
{
std::ostringstream strm;
Json::Value options (Json::arrayValue);
std::stringstream strm;
NL::json options;
for (auto const& n : nv)
{
outputOptions(n, strm);
std::string json(strm.str());
Json::Reader jsonReader;
Json::Value array;
jsonReader.parse(json, array);
options.append(array);

NL::json j;
try
{
strm >> j;
}
catch (NL::json::parse_error&)
{}
options.push_back(j);
strm.str("");
}
m_out << options;
Expand Down
2 changes: 1 addition & 1 deletion cmake/arbiter.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

include(${PDAL_CMAKE_DIR}/curl.cmake)

set(PDAL_ARBITER_ENABLED 0)
if (CURL_FOUND)
set(PDAL_ARBITER_ENABLED 1)
set(PDAL_ARBITER_LIB_NAME pdal_arbiter)
endif()

26 changes: 0 additions & 26 deletions cmake/json.cmake

This file was deleted.

105 changes: 0 additions & 105 deletions cmake/modules/FindJSONCPP.cmake

This file was deleted.

4 changes: 4 additions & 0 deletions cmake/nlohmann.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# N Lohmann JSON handler
#
set(NLOHMANN_INCLUDE_DIR ${PDAL_VENDOR_DIR}/nlohmann)
10 changes: 3 additions & 7 deletions dimbuilder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@ include(${ROOT_DIR}/cmake/common.cmake NO_POLICY_SCOPE)
add_executable(dimbuilder
DimBuilder.cpp
${PDAL_UTIL_DIR}/Utils.cpp
${PDAL_JSONCPP_SRC})
)
target_include_directories(dimbuilder PRIVATE
${PDAL_INCLUDE_DIR}
${PDAL_JSONCPP_INCLUDE_DIR})
${NLOHMANN_INCLUDE_DIR}
)
PDAL_TARGET_COMPILE_SETTINGS(dimbuilder)
target_link_libraries(dimbuilder
PRIVATE
${EXECINFO_LIBRARY}
${CMAKE_DL_LIBS}
)
if (PDAL_HAVE_JSONCPP)
target_link_libraries(dimbuilder
PRIVATE
${PDAL_JSONCPP_LIB_NAME})
endif()

0 comments on commit 136732f

Please sign in to comment.