PORTNAME=	flatcc
DISTVERSIONPREFIX=	v
DISTVERSION=	0.6.1
CATEGORIES=	devel

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	FlatBuffers compiler and library in C for C
WWW=		https://github.com/dvidelabs/flatcc

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		cmake compiler:c++11-lib cpe
CPE_VENDOR=	flatcc_project
USE_LDCONFIG=	yes

USE_GITHUB=	yes
GH_ACCOUNT=	dvidelabs

CMAKE_ON=	BUILD_SHARED_LIBS FLATCC_INSTALL
CMAKE_OFF=	FLATCC_TEST FLATCC_ALLOW_WERROR

PLIST_SUB=	SUFFIX=${WITH_DEBUG:D_d}

do-test:
	@cd ${BUILD_WRKSRC} && \
		${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DFLATCC_TEST:BOOL=ON ${CMAKE_SOURCE_PATH} && \
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \
		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test

.include <bsd.port.mk>
