Mercurial > hg > orthanc-gcp
view Resources/CMake/NlohmannJson.cmake @ 51:f9fe97e893c0
third party downloads from uclouvain servers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 Dec 2023 22:31:24 +0100 |
parents | b388b9d81a1b |
children |
line wrap: on
line source
# curl -L https://raw.githubusercontent.com/nlohmann/json/v3.4.0/single_include/nlohmann/json.hpp | gzip -9 > nlohmann-json-3.4.0.gz set(NLOHMANN_JSON_SOURCE ${CMAKE_BINARY_DIR}/nlohmann-json-3.4.0.hpp) set(NLOHMANN_JSON_URL "https://orthanc.uclouvain.be/downloads/third-party-downloads/dicom-web/nlohmann-json-3.4.0.gz") set(NLOHMANN_JSON_MD5 "f3346873ec78a0c90f1f05e4c2575412") if (EXISTS "${NLOHMANN_JSON_SOURCE}") set(FirstRun OFF) else() set(FirstRun ON) endif() DownloadCompressedFile(${NLOHMANN_JSON_MD5} ${NLOHMANN_JSON_URL} ${NLOHMANN_JSON_SOURCE}) execute_process( COMMAND ${PATCH_EXECUTABLE} -p0 -N -i ${CMAKE_CURRENT_LIST_DIR}/../Patches/nlohmann-json-3.4.0.patch WORKING_DIRECTORY ${CMAKE_BINARY_DIR} RESULT_VARIABLE Failure ) if (FirstRun AND Failure) message(FATAL_ERROR "Error while patching a file") endif() configure_file( ${NLOHMANN_JSON_SOURCE} ${AUTOGENERATED_DIR}/google/cloud/storage/internal/nlohmann_json.hpp ) include_directories( ${CMAKE_SOURCE_DIR}/external/nlohmann_json/include/ )