From dfd8ee00bb406c98dbd06c1704a9198339514f8f Mon Sep 17 00:00:00 2001
From: Chuck Atkins <chuck.atkins@kitware.com>
Date: Mon, 19 Jun 2017 16:13:17 -0400
Subject: [PATCH] XML: Add tooling for the pugixml parser

---
 thirdparty/CMakeLists.txt            |  1 +
 thirdparty/pugixml/CMakeLists.txt    | 12 ++++++++++++
 thirdparty/pugixml/Readme.txt        |  4 ++++
 thirdparty/pugixml/pugixml/delete.me |  0
 thirdparty/pugixml/update.sh         | 23 +++++++++++++++++++++++
 5 files changed, 40 insertions(+)
 create mode 100644 thirdparty/pugixml/CMakeLists.txt
 create mode 100644 thirdparty/pugixml/Readme.txt
 create mode 100644 thirdparty/pugixml/pugixml/delete.me
 create mode 100755 thirdparty/pugixml/update.sh

diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt
index 2ca393877..9cff344a2 100644
--- a/thirdparty/CMakeLists.txt
+++ b/thirdparty/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_subdirectory(KWSys)
 add_subdirectory(NLohmannJson)
+add_subdirectory(pugixml)
 
 if(BUILD_TESTING)
   add_subdirectory(GTest)
diff --git a/thirdparty/pugixml/CMakeLists.txt b/thirdparty/pugixml/CMakeLists.txt
new file mode 100644
index 000000000..07a05515c
--- /dev/null
+++ b/thirdparty/pugixml/CMakeLists.txt
@@ -0,0 +1,12 @@
+# This is an extremely simple and tiny library.  Rather than build it
+# seperately we'll just create an interface library containing the sources and
+# headers
+add_library(pugixml INTERFACE)
+target_sources(pugixml INTERFACE
+  ${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src/pugiconfig.hpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src/pugixml.hpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src/pugixml.cpp
+)
+target_include_directories(pugixml INTERFACE
+  ${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src
+)
diff --git a/thirdparty/pugixml/Readme.txt b/thirdparty/pugixml/Readme.txt
new file mode 100644
index 000000000..f7eeda3e7
--- /dev/null
+++ b/thirdparty/pugixml/Readme.txt
@@ -0,0 +1,4 @@
+This is a copy of the upstream pugixml library located at
+https://github.com/zeux/pugixml. Do not make changes directly to this repo
+but instead to the upstream repository.  Update this copy of pugixml by running
+the update.sh script.
diff --git a/thirdparty/pugixml/pugixml/delete.me b/thirdparty/pugixml/pugixml/delete.me
new file mode 100644
index 000000000..e69de29bb
diff --git a/thirdparty/pugixml/update.sh b/thirdparty/pugixml/update.sh
new file mode 100755
index 000000000..a9a5d99d6
--- /dev/null
+++ b/thirdparty/pugixml/update.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+shopt -s dotglob
+
+readonly name="pugixml"
+readonly ownership="pugixml Upstream <robot@adios2>"
+readonly subtree="thirdparty/pugixml/pugixml"
+readonly repo="https://github.com/zeux/pugixml.git"
+readonly tag="v1.8.1"
+readonly shortlog="true"
+readonly paths="
+src/pugiconfig.hpp
+src/pugixml.hpp
+src/pugixml.cpp
+"
+
+extract_source () {
+    git_archive
+}
+
+. "${BASH_SOURCE%/*}/../update-common.sh"
-- 
GitLab