macro(BuildJsonCpp)
  set(JSONCPP_WITH_TESTS OFF CACHE BOOL "")
  set(JSONCPP_WITH_POST_BUILD_UNITTEST OFF CACHE BOOL "")
  set(JSONCPP_WITH_WARNING_AS_ERROR OFF CACHE BOOL "")
  set(JSONCPP_WITH_STRICT_ISO OFF CACHE BOOL "")
  set(JSONCPP_WITH_PKGCONFIG_SUPPORT OFF CACHE BOOL "")
  set(JSONCPP_WITH_CMAKE_PACKAGE OFF CACHE BOOL "")
  add_subdirectory(${jsoncpp_SOURCE_DIR} ${PROJECT_BINARY_DIR}/jsoncpp_${jsoncpp_VERSION} EXCLUDE_FROM_ALL)
  if (MSVC)
    target_compile_options(jsoncpp_lib_static PRIVATE "/MD$<$<CONFIG:Debug>:d>")
  endif()
  if (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
    target_compile_options(jsoncpp_lib_static PRIVATE -Wno-implicit-int-float-conversion -Wno-macro-redefined)
  endif()
  set_target_properties(jsoncpp_lib_static PROPERTIES FOLDER ExternalProjectTargets/jsoncpp)
endmacro()

