Pull in nlohmann json as a dependency rather than checking in.

This should allow keeping closer to the upstream yocto recipes, and
avoid excess code in the repo

Change-Id: Ib66f7cf69b68bb23f9789580beadf8344cb68cfa
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in
index 3ab0aac..8e39d9b 100644
--- a/CMakeLists.txt.in
+++ b/CMakeLists.txt.in
@@ -47,3 +47,31 @@
     BUILD_COMMAND ""
     INSTALL_COMMAND mkdir -p "${CMAKE_BINARY_DIR}/prefix/include/" && cp -R ${CMAKE_BINARY_DIR}/boost-src/boost ${CMAKE_BINARY_DIR}/prefix/include
 )
+
+ExternalProject_Add(
+    gtest
+    GIT_REPOSITORY
+    "https://github.com/google/googletest.git"
+    GIT_TAG
+    dfa853b63d17c787914b663b50c2095a0c5b706e
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/googletest-build
+    SOURCE_DIR        "${CMAKE_BINARY_DIR}/googletest-src"
+    BINARY_DIR        "${CMAKE_BINARY_DIR}/googletest-build"
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/prefix
+)
+
+ExternalProject_Add(
+    nlohmann-json
+    GIT_REPOSITORY
+    "https://github.com/nlohmann/json.git"
+    GIT_TAG
+    d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe
+    SOURCE_DIR        "${CMAKE_BINARY_DIR}/nlohmann-json-src"
+    BINARY_DIR        "${CMAKE_BINARY_DIR}/nlohmann-json-build"
+    CONFIGURE_COMMAND ""
+    BUILD_COMMAND ""
+    INSTALL_COMMAND mkdir -p "${CMAKE_BINARY_DIR}/prefix/include/nlohmann" &&
+                    cp -r "${CMAKE_BINARY_DIR}/nlohmann-json-src/include/nlohmann"
+                        "${CMAKE_BINARY_DIR}/prefix/include"
+
+)