Skip to content

Commit

Permalink
Introduce VISP_NLOHMANN_JSON() macro to include nlohmann_json headers.
Browse files Browse the repository at this point in the history
It allows to consider nlohman_json header installed either in the system or the one coming from VTK when PCL is used
  • Loading branch information
fspindle committed Oct 31, 2024
1 parent f32328b commit 308aa1d
Show file tree
Hide file tree
Showing 34 changed files with 91 additions and 46 deletions.
20 changes: 18 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,17 @@ if(USE_PCL)
set(PCL_REQUIRED_COMPONENTS "common;filters;io;visualization;segmentation")
# Create cmake vars corresponding to pcl components used by ViSP like VISP_HAVE_PCL_COMMON...
vp_detect_required_pcl_components(PCL_REQUIRED_COMPONENTS)

# USE_NLOHMANN_JSON is set to ON if nlohmann_json is installed and found thanks to nlohmann_jsonConfig.cmake.
# VTK that is a PCL 3rd party embbed also a built in version of nlohmann_json.
# Here we add a specific case to consider the nlohmann version coming from VTK when the system version is not found
if(NOT USE_NLOHMANN_JSON)
if(VISP_HAVE_NLOHMANN_JSON_FROM_VTK)
message(WARNING "json 3rd party is detected and used as a VTK 3rd party which is itself a PCL 3rd party. Thus we enable nlohmann json usage turning USE_NLOHMANN_JSON=ON.")
unset(USE_NLOHMANN_JSON)
set(USE_NLOHMANN_JSON ON CACHE BOOL "Include nlohmann json support thanks to VTK" FORCE)
endif()
endif()
endif()

# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -1090,7 +1101,8 @@ VP_SET(VISP_HAVE_THREADS TRUE IF (BUILD_MODULE_visp_core AND USE_THREADS))
VP_SET(VISP_HAVE_XML2 TRUE IF (BUILD_MODULE_visp_core AND USE_XML2))
VP_SET(VISP_HAVE_PCL TRUE IF (BUILD_MODULE_visp_core AND USE_PCL))
VP_SET(VISP_HAVE_TENSORRT TRUE IF (BUILD_MODULE_visp_core AND USE_TENSORRT))
VP_SET(VISP_HAVE_NLOHMANN_JSON TRUE IF (BUILD_MODULE_visp_core AND USE_NLOHMANN_JSON))
VP_SET(VISP_HAVE_NLOHMANN_JSON TRUE IF (BUILD_MODULE_visp_core AND USE_NLOHMANN_JSON))
VP_SET(VISP_HAVE_NLOHMANN_JSON_FROM_VTK TRUE IF (BUILD_MODULE_visp_core AND VISP_HAVE_NLOHMANN_JSON_FROM_VTK))

VP_SET(VISP_HAVE_OGRE TRUE IF (BUILD_MODULE_visp_ar AND USE_OGRE))
VP_SET(VISP_HAVE_OIS TRUE IF (BUILD_MODULE_visp_ar AND USE_OIS))
Expand Down Expand Up @@ -1844,7 +1856,11 @@ status(" Misc: ")
status(" Use Clipper (built-in):" WITH_CLIPPER THEN "yes (ver ${CLIPPER_VERSION})" ELSE "no")
status(" Use pugixml (built-in):" WITH_PUGIXML THEN "yes (ver ${PUGIXML_VERSION})" ELSE "no")
status(" Use libxml2:" USE_XML2 THEN "yes (ver ${XML2_VERSION_STRING})" ELSE "no")
status(" Use json (nlohmann):" USE_NLOHMANN_JSON THEN "yes (ver ${nlohmann_json_VERSION})" ELSE "no")
if(VISP_HAVE_NLOHMANN_JSON_FROM_VTK)
status(" Use json (nlohmann vtk):" USE_NLOHMANN_JSON THEN "yes (ver ${VTK_NLOHMANN_JSON_VERSION})" ELSE "no")
else()
status(" Use json (nlohmann system):" USE_NLOHMANN_JSON THEN "yes (ver ${nlohmann_json_VERSION})" ELSE "no")
endif()
status("")
status(" Optimization: ")
status(" Use OpenMP:" USE_OPENMP THEN "yes" ELSE "no")
Expand Down
15 changes: 15 additions & 0 deletions cmake/PCLTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,21 @@ macro(vp_find_pcl pcl_libraries pcl_deps_include_dirs pcl_deps_libraries)
endif()
endforeach()

find_path(VTK_NLOHMANN_JSON_INCLUDE_DIR vtknlohmannjson/include/vtknlohmann/json.hpp
PATHS
${PCL_VTK_IMPORTED_INCS}
)
mark_as_advanced(VTK_NLOHMANN_JSON_INCLUDE_DIR)
if(VTK_NLOHMANN_JSON_INCLUDE_DIR)
vp_parse_header("${VTK_NLOHMANN_JSON_INCLUDE_DIR}/vtknlohmannjson/include/vtknlohmann/json.hpp" NLOHMANN_JSON_VERSION_LINES NLOHMANN_JSON_VERSION_MAJOR NLOHMANN_JSON_VERSION_MINOR NLOHMANN_JSON_VERSION_PATCH)
set(VTK_NLOHMANN_JSON_VERSION "${NLOHMANN_JSON_VERSION_MAJOR}.${NLOHMANN_JSON_VERSION_MINOR}.${NLOHMANN_JSON_VERSION_PATCH}")
list(APPEND ${pcl_deps_include_dirs} "${VTK_NLOHMANN_JSON_INCLUDE_DIR}/vtknlohmannjson/include")
set(VISP_HAVE_NLOHMANN_JSON_FROM_VTK TRUE)
else()
set(VISP_HAVE_NLOHMANN_JSON_FROM_VTK FALSE)
set(VTK_NLOHMANN_JSON_VERSION "n/a")
endif()

# On win10 + msvc 15 2017 with pcl 1.9.1 opengl32.lib needed by vtkRenderingOpenGL-8.1-gd.lib is not found
# Here we explicitly add opengl
if(OPENGL_LIBRARIES)
Expand Down
12 changes: 11 additions & 1 deletion cmake/VISPUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,14 @@ function(status text)
endfunction()

# read set of version defines from the header file
# This macro allows to get defines values from a header file.
# For example if the header.hpp file contains
# #define LIB_VERSION_MAJOR 1
# #define LIB_VERSION_MINOR 2
# #define LIB_VERSION_PATCH 3
# to retrieve the values of these defines and compose a string version you may use
# vp_parse_header("header.hpp" LIB_VERSION_LINES LIB_VERSION_MAJOR LIB_VERSION_MINOR LIB_VERSION_PATCH)
# set(LIB_VERSION "${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH}")
macro(vp_parse_header FILENAME FILE_VAR)
set(vars_regex "")
set(__parent_scope OFF)
Expand Down Expand Up @@ -1289,6 +1297,9 @@ macro(vp_parse_header FILENAME FILE_VAR)
endmacro()

# read single version define from the header file
# Example to detect the version in header.hpp file that contains:
# #define MyLIB_VERSION_STR "1.2.3"
# use vp_parse_header2(MyLIB "header.hpp" LIB_VERSION_STR)
macro(vp_parse_header2 LIBNAME HDR_PATH VARNAME)
vp_clear_vars(${LIBNAME}_VERSION_MAJOR
${LIBNAME}_VERSION_MAJOR
Expand All @@ -1300,7 +1311,6 @@ macro(vp_parse_header2 LIBNAME HDR_PATH VARNAME)
if(EXISTS "${HDR_PATH}")
file(STRINGS "${HDR_PATH}" ${LIBNAME}_H REGEX "^#define[ \t]+${VARNAME}[ \t]+\"[^\"]*\".*$" LIMIT_COUNT 1)
endif()

if(${LIBNAME}_H)
string(REGEX REPLACE "^.*[ \t]${VARNAME}[ \t]+\"([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_MAJOR "${${LIBNAME}_H}")
string(REGEX REPLACE "^.*[ \t]${VARNAME}[ \t]+\"[0-9]+\\.([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_MINOR "${${LIBNAME}_H}")
Expand Down
20 changes: 12 additions & 8 deletions cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2023 by Inria. All rights reserved.
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -524,15 +524,19 @@ namespace vp = VISP_NAMESPACE_NAME;
// Defined if we want to use openmp
#cmakedefine VISP_HAVE_OPENMP

// Defined if nlohmann json parser is found
// Defined if nlohmann json parser is found (either system or coming from VTK)
#cmakedefine VISP_HAVE_NLOHMANN_JSON

// Workaround for issue https://github.com/lagadic/visp/issues/1485
#if defined(VISP_HAVE_NLOHMANN_JSON) && defined(VISP_HAVE_PCL_VISUALIZATION)
#include <vtkVersion.h>
#if VTK_VERSION_NUMBER_QUICK >= VTK_VERSION_CHECK(9, 2, 0)
#include <pcl/visualization/pcl_visualizer.h>
#endif
// Defined if nlohmann json parser is found in PCL thanks to VTK 3rd party
#cmakedefine VISP_HAVE_NLOHMANN_JSON_FROM_VTK

#ifdef VISP_HAVE_NLOHMANN_JSON
# if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_NLOHMANN_JSON_FROM_VTK)
# include <vtk_nlohmannjson.h>
# define VISP_NLOHMANN_JSON(x) <vtknlohmannjson/include/vtknlohmann/x>
# else
# define VISP_NLOHMANN_JSON(x) <nlohmann/x>
# endif
#endif

// Define c++ standard values also available in __cplusplus when gcc is used
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/misc/tutorial-json.dox
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Much of this section is a repeat of the library's documentation, available <a ta

To use JSON in your code you should first include the relevant header:
\code{.cpp}
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; // For convenience
\endcode

Expand Down Expand Up @@ -62,7 +62,7 @@ void to_json(json& j, const YourType& t);
\endcode
These functions must be defined in the same scope namespace as YourType and must be accessible everywhere YourType is used. It is thus common to define it in the header where YourType is defined.
\code
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)

class YourType {
public:
Expand Down
2 changes: 1 addition & 1 deletion modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ if(USE_OPENMP)
endforeach()
endif()

if(USE_NLOHMANN_JSON)
if(USE_NLOHMANN_JSON AND NOT VISP_HAVE_NLOHMANN_JSON_FROM_VTK)
get_target_property(_inc_dirs "nlohmann_json::nlohmann_json" INTERFACE_INCLUDE_DIRECTORIES)
list(APPEND opt_incs ${_inc_dirs})
endif()
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpArray2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <visp3/core/vpException.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

BEGIN_VISP_NAMESPACE
Expand Down
4 changes: 2 additions & 2 deletions modules/core/include/visp3/core/vpCameraParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <visp3/core/vpMatrix.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include<nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

BEGIN_VISP_NAMESPACE
Expand Down Expand Up @@ -451,7 +451,7 @@ class VISP_EXPORT vpCameraParameters
};

#ifdef VISP_HAVE_NLOHMANN_JSON
#include<nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
NLOHMANN_JSON_SERIALIZE_ENUM(vpCameraParameters::vpCameraParametersProjType, {
{vpCameraParameters::perspectiveProjWithoutDistortion, "perspectiveWithoutDistortion"},
{vpCameraParameters::perspectiveProjWithDistortion, "perspectiveWithDistortion"},
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpCannyEdgeDetection.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

// 3rd parties include
#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

BEGIN_VISP_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpColVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <visp3/core/vpConfig.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif
BEGIN_VISP_NAMESPACE
class vpMatrix;
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpHomogeneousMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ END_VISP_NAMESPACE
#include <visp3/core/vpPoseVector.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

BEGIN_VISP_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpJsonParsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <visp3/core/vpConfig.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)

BEGIN_VISP_NAMESPACE
/*!
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpPolygon3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class VISP_EXPORT vpPolygon3D
END_VISP_NAMESPACE

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#include <visp3/core/vpJsonParsing.h>
NLOHMANN_JSON_SERIALIZE_ENUM(VISP_NAMESPACE_ADDRESSING vpPolygon3D::vpPolygon3DClippingType, {
{VISP_NAMESPACE_ADDRESSING vpPolygon3D::NO_CLIPPING, "none"},
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpPoseVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class VISP_EXPORT vpPoseVector : public vpArray2D<double>
};

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
inline void to_json(nlohmann::json &j, const vpPoseVector &r)
{
r.convert_to_json(j);
Expand Down
2 changes: 1 addition & 1 deletion modules/core/test/camera/catchJsonCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <visp3/core/vpIoTools.h>

#if defined(VISP_HAVE_NLOHMANN_JSON) && defined(VISP_HAVE_CATCH2)
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; //! json namespace shortcut

#include <catch_amalgamated.hpp>
Expand Down
2 changes: 1 addition & 1 deletion modules/core/test/math/catchJsonArrayConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <visp3/core/vpArray2D.h>
#include <visp3/core/vpIoTools.h>

#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; //! json namespace shortcut

#include <catch_amalgamated.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <optional>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

BEGIN_VISP_NAMESPACE
Expand Down
6 changes: 3 additions & 3 deletions modules/gui/src/pointcloud/vpPclViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@

#include <visp3/core/vpConfig.h>
#if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_IO) && defined(VISP_HAVE_THREADS)
// PCL
#include <pcl/io/pcd_io.h>

// ViSP
#include <visp3/gui/vpPclViewer.h>
#include <visp3/gui/vpColorBlindFriendlyPalette.h>
#include <visp3/core/vpIoTools.h>

// PCL
#include <pcl/io/pcd_io.h>

BEGIN_VISP_NAMESPACE
const std::vector<vpColorBlindFriendlyPalette::Palette> gcolor = { vpColorBlindFriendlyPalette::Palette::Green, vpColorBlindFriendlyPalette::Palette::Vermillon,vpColorBlindFriendlyPalette::Palette::Blue,
vpColorBlindFriendlyPalette::Palette::Black, vpColorBlindFriendlyPalette::Palette::Orange, vpColorBlindFriendlyPalette::Palette::Purple,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

// 3rd parties inclue
#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_17)
Expand Down
2 changes: 1 addition & 1 deletion modules/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if(WITH_STBIMAGE)
include_directories(${STBIMAGE_INCLUDE_DIRS})
endif()

if(USE_NLOHMANN_JSON)
if(USE_NLOHMANN_JSON AND NOT VISP_HAVE_NLOHMANN_JSON_FROM_VTK)
get_target_property(_inc_dirs "nlohmann_json::nlohmann_json" INTERFACE_INCLUDE_DIRECTORIES)
list(APPEND opt_incs ${_inc_dirs})
endif()
Expand Down
2 changes: 1 addition & 1 deletion modules/io/include/visp3/io/vpJsonArgumentParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_NLOHMANN_JSON)
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#include <visp3/core/vpException.h>
#include <sstream>

Expand Down
2 changes: 1 addition & 1 deletion modules/io/test/catchJsonArgumentParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <visp3/io/vpJsonArgumentParser.h>

#if defined(VISP_HAVE_NLOHMANN_JSON) && defined(VISP_HAVE_CATCH2)
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; //! json namespace shortcut

#include <catch_amalgamated.hpp>
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/dnn/include/visp3/dnn_tracker/vpMegaPose.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <visp3/core/vpRGBa.h>
#include <visp3/core/vpRect.h>

#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)

BEGIN_VISP_NAMESPACE
/**
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/mbt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if(USE_PCL)
list(APPEND opt_libs ${PCL_DEPS_LIBRARIES})
endif()

if(USE_NLOHMANN_JSON)
if(USE_NLOHMANN_JSON AND NOT VISP_HAVE_NLOHMANN_JSON_FROM_VTK)
get_target_property(_inc_dirs "nlohmann_json::nlohmann_json" INTERFACE_INCLUDE_DIRECTORIES)
list(APPEND opt_incs ${_inc_dirs})
endif()
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/mbt/include/visp3/mbt/vpMbGenericTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <visp3/mbt/vpMbKltTracker.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json_fwd.hpp>
#include VISP_NLOHMANN_JSON(json_fwd.hpp)
#include <visp3/core/vpJsonParsing.h>
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class VISP_EXPORT vpMbtFaceDepthNormal
END_VISP_NAMESPACE

#ifdef VISP_HAVE_NLOHMANN_JSON
#include<nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON) && defined(VISP_HAVE_PCL_SEGMENTATION) && defined(VISP_HAVE_PCL_FILTERS)
NLOHMANN_JSON_SERIALIZE_ENUM(VISP_NAMESPACE_ADDRESSING vpMbtFaceDepthNormal::vpFeatureEstimationType, {
{VISP_NAMESPACE_ADDRESSING vpMbtFaceDepthNormal::ROBUST_FEATURE_ESTIMATION, "robust"},
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/mbt/src/vpMbGenericTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <visp3/mbt/vpMbtXmlGenericParser.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; //! json namespace shortcut
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <visp3/mbt/vpMbGenericTracker.h>

#if defined(VISP_HAVE_NLOHMANN_JSON) && defined(VISP_HAVE_CATCH2)
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; //! json namespace shortcut

#include <catch_amalgamated.hpp>
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/me/include/visp3/me/vpMe.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <visp3/core/vpMatrix.h>

#ifdef VISP_HAVE_NLOHMANN_JSON
#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
#endif

BEGIN_VISP_NAMESPACE
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/me/test/catchJsonMe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <visp3/core/vpIoTools.h>
#include <visp3/me/vpMe.h>

#include <nlohmann/json.hpp>
#include VISP_NLOHMANN_JSON(json.hpp)
using json = nlohmann::json; //! json namespace shortcut

#include <catch_amalgamated.hpp>
Expand Down
Loading

0 comments on commit 308aa1d

Please sign in to comment.