From 9a8665ff3f2099e34ceff50afe663c0108f70ddb Mon Sep 17 00:00:00 2001
From: Chuck Atkins <chuck.atkins@kitware.com>
Date: Mon, 8 May 2017 09:30:07 -0400
Subject: [PATCH] Added infrastructure for json.hpp as a third party library

---
 thirdparty/CMakeLists.txt              |  1 +
 thirdparty/NLohmannJson/CMakeLists.txt |  4 ++++
 thirdparty/NLohmannJson/Readme.txt     |  4 ++++
 thirdparty/NLohmannJson/json/empty     |  0
 thirdparty/NLohmannJson/update.sh      | 22 ++++++++++++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 thirdparty/NLohmannJson/CMakeLists.txt
 create mode 100644 thirdparty/NLohmannJson/Readme.txt
 create mode 100644 thirdparty/NLohmannJson/json/empty
 create mode 100755 thirdparty/NLohmannJson/update.sh

diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
index 5db05938c..006157536 100644
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_subdirectory(KWSys)
+add_subdirectory(NLohmannJson)
 
 if(BUILD_TESTING)
   add_subdirectory(GTest)
diff --git a/thirdparty/NLohmannJson/CMakeLists.txt b/thirdparty/NLohmannJson/CMakeLists.txt
new file mode 100644
index 000000000..7aaef186f
--- /dev/null
+++ b/thirdparty/NLohmannJson/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_library(NLohmannJson INTERFACE)
+target_include_directories(NLohmannJson
+  INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/json/src
+)
diff --git a/thirdparty/NLohmannJson/Readme.txt b/thirdparty/NLohmannJson/Readme.txt
new file mode 100644
index 000000000..d4264273b
--- /dev/null
+++ b/thirdparty/NLohmannJson/Readme.txt
@@ -0,0 +1,4 @@
+This is a copy of the upstream JSON For Modern C++ library located at
+https://github.com/nlohmann/json. Do not make changes directly to this repo
+but instead to the upstream repository.  Update this copy of json.hpp by running
+the update.sh script.
diff --git a/thirdparty/NLohmannJson/json/empty b/thirdparty/NLohmannJson/json/empty
new file mode 100644
index 000000000..e69de29bb
diff --git a/thirdparty/NLohmannJson/update.sh b/thirdparty/NLohmannJson/update.sh
new file mode 100755
index 000000000..0fa3ffca3
--- /dev/null
+++ b/thirdparty/NLohmannJson/update.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+shopt -s dotglob
+
+readonly name="NLohmannJson"
+readonly ownership="JSON For Modern C++ Upstream <robot@adios2>"
+readonly subtree="thirdparty/NLohmannJson/json"
+readonly repo="https://github.com/nlohmann/json.git"
+readonly tag="v2.1.1"
+readonly shortlog="true"
+readonly paths="
+LICENSE.MIT
+src/json.hpp
+"
+
+extract_source () {
+    git_archive
+}
+
+. "${BASH_SOURCE%/*}/../update-common.sh"
-- 
GitLab