# https://github.com/nlohmann/json
#
# https://github.com/nlohmann/json/archive/refs/tags/v3.9.1.zip

### VERSION ###
DKSET(JSON_MAJOR 3)
DKSET(JSON_MINOR 9)
DKSET(JSON_BUILD 1)
DKSET(JSON_VERSION ${JSON_MAJOR}.${JSON_MINOR}.${JSON_BUILD})
DKSET(JSON_NAME json-${JSON_VERSION})
DKSET(JSON_DL https://github.com/nlohmann/json/archive/refs/tags/v${JSON_VERSION}.zip)
DKSET(JSON ${3RDPARTY}/${JSON_NAME})


### INSTALL ###
DKINSTALL(${JSON_DL} json ${JSON})
DKINCLUDE(${JSON}/include/nlohmann)


# This is a header onlu library, he compileable stuff below is unit testing
# include "json.hpp" to use this library 
return()

### COMPILE ###
WIN_PATH(${JSON}/${OS})
WIN32_COMMAND(${DKCMAKE_WIN32} ${JSON})
WIN64_COMMAND(${DKCMAKE_WIN64} ${JSON})
WIN_VS(${JSON_NAME} nlohmann_json.sln json_unit)


MAC_PATH(${JSON}/${OS})
MAC64_COMMAND(${DKCMAKE_MAC64} ${JSON})
MAC_XCODE(${JSON_NAME} json_unit)


IOS_PATH(${JSON}/${OS})
IOS64_COMMAND(${DKCMAKE_IOS64} ${JSON})
IOS_XCODE(${JSON_NAME} json_unit)


IOSSIM_PATH(${JSON}/${OS})
IOSSIM64_COMMAND(${DKCMAKE_IOSSIM64} ${JSON})
IOSSIM_XCODE(${JSON_NAME} json_unit)


LINUX_DEBUG_PATH(${JSON}/${OS}/${DEBUG_DIR})
LINUX_DEBUG_COMMAND(${DKCMAKE_LINUX_DEBUG} ${JSON})
LINUX_DEBUG_COMMAND(make all)

LINUX_RELEASE_PATH(${JSON}/${OS}/${RELEASE_DIR})
LINUX_RELEASE_COMMAND(${DKCMAKE_LINUX_RELEASE} ${JSON})
LINUX_RELEASE_COMMAND(make all)


RASPBERRY_DEBUG_PATH(${JSON}/${OS}/${DEBUG_DIR})
RASPBERRY_DEBUG_COMMAND(${DKCMAKE_RASPBERRY_DEBUG} ${JSON})
RASPBERRY_DEBUG_COMMAND(make all)

RASPBERRY_RELEASE_PATH(${JSON}/${OS}/${RELEASE_DIR})
RASPBERRY_RELEASE_COMMAND(${DKCMAKE_RASPBERRY_RELEASE} ${JSON})
RASPBERRY_RELEASE_COMMAND(make all)


ANDROID_NDK(${JSON_NAME})
