diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-04-23 14:17:22 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-04-30 13:27:25 +0200 |
| commit | 29ac85d55273e83a3ada19037959ae7c7823f5b7 (patch) | |
| tree | 060870053824413937ed2752e5b8f2c791e57530 /include | |
| parent | 36ac12c74210083ff3d699c9a57bf8b421939483 (diff) | |
| download | PROJ-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')
| -rw-r--r-- | include/proj/internal/Makefile.am | 2 | ||||
| -rw-r--r-- | include/proj/internal/include_nlohmann_json.hpp | 15 | ||||
| -rw-r--r-- | include/proj/internal/vendor/Makefile.am | 1 | ||||
| -rw-r--r-- | include/proj/internal/vendor/nlohmann/Makefile.am (renamed from include/proj/internal/nlohmann/Makefile.am) | 0 | ||||
| -rw-r--r-- | include/proj/internal/vendor/nlohmann/json.hpp (renamed from include/proj/internal/nlohmann/json.hpp) | 0 |
5 files changed, 16 insertions, 2 deletions
diff --git a/include/proj/internal/Makefile.am b/include/proj/internal/Makefile.am index 8e9edacf..b3fb57eb 100644 --- a/include/proj/internal/Makefile.am +++ b/include/proj/internal/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = nlohmann +SUBDIRS = vendor noinst_HEADERS = \ coordinatesystem_internal.hpp \ 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 diff --git a/include/proj/internal/vendor/Makefile.am b/include/proj/internal/vendor/Makefile.am new file mode 100644 index 00000000..7d8176b2 --- /dev/null +++ b/include/proj/internal/vendor/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = nlohmann diff --git a/include/proj/internal/nlohmann/Makefile.am b/include/proj/internal/vendor/nlohmann/Makefile.am index eaf3200e..eaf3200e 100644 --- a/include/proj/internal/nlohmann/Makefile.am +++ b/include/proj/internal/vendor/nlohmann/Makefile.am diff --git a/include/proj/internal/nlohmann/json.hpp b/include/proj/internal/vendor/nlohmann/json.hpp index a70aaf8c..a70aaf8c 100644 --- a/include/proj/internal/nlohmann/json.hpp +++ b/include/proj/internal/vendor/nlohmann/json.hpp |
