mirror of https://github.com/Icinga/icinga2.git
Integrate nlohmann_json into CMake
Better integration into base/json.cpp Signed-off-by: Alexander A. Klimov <alexander.klimov@icinga.com>
This commit is contained in:
parent
89b371813f
commit
724b34c6f2
|
@ -153,6 +153,10 @@ else()
|
||||||
list(APPEND base_DEPS ${YAJL_LIBRARIES})
|
list(APPEND base_DEPS ${YAJL_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# JSON
|
||||||
|
find_package(JSON)
|
||||||
|
include_directories(${JSON_INCLUDE})
|
||||||
|
|
||||||
find_package(Editline)
|
find_package(Editline)
|
||||||
set(HAVE_EDITLINE "${EDITLINE_FOUND}")
|
set(HAVE_EDITLINE "${EDITLINE_FOUND}")
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
FIND_PATH (JSON_INCLUDE json.hpp HINTS "${PROJECT_SOURCE_DIR}/third-party/nlohmann_json")
|
||||||
|
|
||||||
|
if (JSON_INCLUDE)
|
||||||
|
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||||
|
|
||||||
|
message(STATUS "Found JSON: ${JSON_INCLUDE}" )
|
||||||
|
else ()
|
||||||
|
message(FATAL_ERROR "Unable to include json.hpp")
|
||||||
|
endif ()
|
|
@ -11,6 +11,7 @@
|
||||||
#include <yajl/yajl_version.h>
|
#include <yajl/yajl_version.h>
|
||||||
#include <yajl/yajl_gen.h>
|
#include <yajl/yajl_gen.h>
|
||||||
#include <yajl/yajl_parse.h>
|
#include <yajl/yajl_parse.h>
|
||||||
|
#include <json.hpp>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
Loading…
Reference in New Issue