PORTNAME=	libcjson
PORTVERSION=	1.7.18
DISTVERSIONPREFIX=	v
PORTREVISION=	2
CATEGORIES=	devel

MAINTAINER=	sunpoet@FreeBSD.org
COMMENT=	Ultralightweight JSON parser in ANSI C
WWW=		https://github.com/DaveGamble/cJSON

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		cmake:testing compiler:c11 pathfix

CMAKE_OFF=	CJSON_OVERRIDE_BUILD_SHARED_LIBS \
		ENABLE_CJSON_TEST \
		ENABLE_CUSTOM_COMPILER_FLAGS \
		ENABLE_HIDDEN_SYMBOLS \
		ENABLE_SAFE_STACK \
		ENABLE_SANITIZERS
CMAKE_ON=	BUILD_SHARED_AND_STATIC_LIBS \
		BUILD_SHARED_LIBS \
		CJSON_BUILD_SHARED_LIBS \
		ENABLE_CJSON_UNINSTALL \
		ENABLE_CJSON_UTILS \
		ENABLE_CJSON_VERSION_SO \
		ENABLE_LOCALES \
		ENABLE_PUBLIC_SYMBOLS \
		ENABLE_TARGET_EXPORT
CMAKE_TESTING_ON=	\
		ENABLE_CJSON_TEST \
		ENABLE_SAFE_STACK
USE_CSTD=	c11
USE_LDCONFIG=	yes

PLIST_SUB=	PORTVERSION=${PORTVERSION}

USE_GITHUB=	yes
GH_ACCOUNT=	DaveGamble
GH_PROJECT=	cJSON

.include <bsd.port.mk>
