aboutsummaryrefslogtreecommitdiff
path: root/include/proj/internal/include_nlohmann_json.hpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-04-23 14:17:22 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-04-30 13:27:25 +0200
commit29ac85d55273e83a3ada19037959ae7c7823f5b7 (patch)
tree060870053824413937ed2752e5b8f2c791e57530 /include/proj/internal/include_nlohmann_json.hpp
parent36ac12c74210083ff3d699c9a57bf8b421939483 (diff)
downloadPROJ-29ac85d55273e83a3ada19037959ae7c7823f5b7.tar.gz
PROJ-29ac85d55273e83a3ada19037959ae7c7823f5b7.zip
CMake build: add a NLOHMANN_JSON_ORIGIN=auto/external/internal setting allowing to choose which nlohmann/json to use
Co-authored-by: Mike Taves <mwtoews@gmail.com>
Diffstat (limited to 'include/proj/internal/include_nlohmann_json.hpp')
-rw-r--r--include/proj/internal/include_nlohmann_json.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/proj/internal/include_nlohmann_json.hpp b/include/proj/internal/include_nlohmann_json.hpp
index 68b6836d..6fa5cd2d 100644
--- a/include/proj/internal/include_nlohmann_json.hpp
+++ b/include/proj/internal/include_nlohmann_json.hpp
@@ -26,13 +26,26 @@
* DEALINGS IN THE SOFTWARE.
****************************************************************************/
+#ifndef INCLUDE_NLOHMANN_JSON_HPP
+#define INCLUDE_NLOHMANN_JSON_HPP
+
#if defined(__GNUC__)
#pragma GCC system_header
#endif
+#ifdef EXTERNAL_NLOHMANN_JSON
+
+#include <nlohmann/json.hpp>
+
+#else // !EXTERNAL_NLOHMANN_JSON
+
// to avoid any clash if PROJ users have another version of nlohmann/json.hpp
#define nlohmann proj_nlohmann
#if !defined(DOXYGEN_ENABLED)
-#include "nlohmann/json.hpp"
+#include "vendor/nlohmann/json.hpp"
#endif
+
+#endif // EXTERNAL_NLOHMANN_JSON
+
+#endif // INCLUDE_NLOHMANN_JSON_HPP