summary refs log tree commit diff
path: root/deps/cmake/Json.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'deps/cmake/Json.cmake')
-rw-r--r--deps/cmake/Json.cmake40
1 files changed, 15 insertions, 25 deletions
diff --git a/deps/cmake/Json.cmake b/deps/cmake/Json.cmake
index a37cc325..3b63550e 100644
--- a/deps/cmake/Json.cmake
+++ b/deps/cmake/Json.cmake
@@ -1,29 +1,19 @@
 ExternalProject_Add(
-    Json
-    PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/Json
-    GIT_REPOSITORY https://github.com/nlohmann/json.git
-    # For shallow git clone (without downloading whole history)
-    # GIT_SHALLOW 1
-    # For point at certain tag
-    GIT_TAG v3.2.0
-    #disables auto update on every build
-    UPDATE_DISCONNECTED 1
-    #disable following
-    CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_DIR "" INSTALL_COMMAND ""
-    )
-# Update json target
-add_custom_target(external-Json-update
-    COMMENT "Updated Nlohmann/Json"
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Json/src/Json
-    COMMAND ${GIT_EXECUTABLE} pull
-    DEPENDS Json)
+  Json
 
-#ExternalProject_Add(
-#  json
-#
-#
-#  DOWNLOAD_COMMAND  file(DOWNLOAD ${JSON_HEADER_URL} ${DEPS_INSTALL_DIR}/include/json.hpp
-#    EXPECTED_HASH SHA256=${JSON_HEADER_HASH})
-#)
+  GIT_REPOSITORY ${JSON_URL}
+  GIT_TAG ${JSON_TAG}
+
+  BUILD_IN_SOURCE 1
+  SOURCE_DIR ${DEPS_BUILD_DIR}/json
+
+  CONFIGURE_COMMAND ${CMAKE_COMMAND}
+        -DJSON_BuildTests=OFF
+        -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
+        -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+
+  BUILD_COMMAND ${CMAKE_COMMAND} --build ${DEPS_BUILD_DIR}/json 
+  INSTALL_COMMAND make install
+)
 
 list(APPEND THIRD_PARTY_DEPS Json)