# $FreeBSD: tags/RELEASE_10_3_0/graphics/opensubdiv/Makefile 403956 2015-12-18 08:16:57Z mva $

PORTNAME=	opensubdiv
PORTVERSION=	3.0.3
PORTREVISION=	1
CATEGORIES=	graphics devel

MAINTAINER=	mva@FreeBSD.org
COMMENT=	High performance subdivision surface libraries

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE.txt

BUILD_DEPENDS=	${LOCALBASE}/include/GLFW/glfw3.h:${PORTSDIR}/graphics/glfw

USE_GITHUB=	yes
GH_ACCOUNT=	PixarAnimationStudios
GH_PROJECT=	OpenSubdiv
GH_TAGNAME=	v3_0_3

USE_LDCONFIG=	yes
USE_GL=		glew
USES=		cmake:outsource compiler pkgconfig
USE_XORG=	x11 xi xcursor xrandr xxf86vm xinerama

CMAKE_ARGS+=	-DNO_TUTORIALS:BOOL=ON -DNO_EXAMPLES:BOOL=ON \
		-DNO_REGRESSION:BOOL=ON -DNO_PTEX:BOOL=ON -DNO_CUDA:BOOL=ON \
		-DNO_OPENCL:BOOL=ON -DNO_MAYA:BOOL=ON -DNO_TBB:BOOL=ON

OPTIONS_DEFINE=	DOCS

.include <bsd.port.pre.mk>

.if ${CHOSEN_COMPILER_TYPE:Mgcc}
# OpenMP is available
PLIST_SUB+=	OPENMP=""
.else
PLIST_SUB+=	OPENMP="@comment "
.endif

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
BUILD_DEPENDS+=	doxygen:${PORTSDIR}/devel/doxygen \
		python2:${PORTSDIR}/lang/python2 \
		rst2html:${PORTSDIR}/textproc/py-docutils
.else
CMAKE_ARGS+=	-DNO_DOC:BOOL=ON
.endif

.include <bsd.port.post.mk>
