SUMMARY="JSON for Modern C++"
DESCRIPTION="One-header JSON library with intuitive syntax."
HOMEPAGE="https://github.com/nlohmann/json"
COPYRIGHT="2013-2021 Niels Lohmann"
LICENSE="MIT"
REVISION="2"
SOURCE_URI="http://github.com/nlohmann/json/archive/v$portVersion/json-$portVersion.tar.gz"
CHECKSUM_SHA256="1155fd1a83049767360e9a120c43c578145db3204d2b309eba49fbbedd0f4ed3"
SOURCE_FILENAME="nlohmann-json.v$portVersion.tar.gz"
SOURCE_DIR="json-$portVersion"

ARCHITECTURES="any"

PROVIDES="
	nlohmann_json = $portVersion
	devel:nlohmann_json = $portVersion
	"

BUILD_PREREQUIRES="
	cmd:cmake
	cmd:make
	"

BUILD()
{
	sed -i -e "s|:include>|:${relativeIncludeDir}>|" \
		-e "s/CMAKE_INSTALL_LIBDIR/CMAKE_INSTALL_DATADIR/g" CMakeLists.txt
	cmake -B build -S . $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_COMPILER=/bin/true \
		-Wno-dev \
		-DJSON_MultipleHeaders=ON \
		-DJSON_BuildTests=OFF
	make -C build $jobArgs
}

INSTALL()
{
	make -C build install
}
