cmake_minimum_required(VERSION 3.2)

# json11 settings
include(ExternalProject)

set(JSON11_PROJECT_NAME json11)
set(JSON11_GIT_REPOSITORY https://github.com/ngc-developers/json11.git)
set(JSON11_GIT_TAG v1.3)

ExternalProject_Add(
  ${JSON11_PROJECT_NAME}
  GIT_REPOSITORY ${JSON11_GIT_REPOSITORY}
  GIT_TAG ${JSON11_GIT_TAG}
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/projects/${JSON11_PROJECT_NAME}
  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${INSTALL_EXTERNAL_PROJECTS_PREFIX}
             -DJSON11_BUILD_TESTS=off
  LOG_DOWNLOAD on
  )

set(JSON11_INCLUDE_PATH ${INSTALL_EXTERNAL_PROJECTS_PREFIX}/include)
set(JSON11_LIBRARY ${INSTALL_EXTERNAL_PROJECTS_PREFIX}/lib/libjson11.a)

set(BUILD_EXTERNAL_PROJECT_NAMES ${BUILD_EXTERNAL_PROJECT_NAMES}
    ${JSON11_PROJECT_NAME})
