# New ports collection makefile for:   enblend
# Date created:        Wed Sep 23 09:46:30 UTC 2009
# Whom:                argv[0] (Iouri V. Ivliev)
#
# $FreeBSD$

PORTNAME=	enblend
PORTVERSION=	4.0
PORTEPOCH=	0
PORTREVISION=	1
CATEGORIES=	graphics
MASTER_SITES=	SF
MASTER_SITE_SUBDIR=	${PORTNAME}/${PORTNAME}-enfuse/${PORTNAME}-enfuse-${PORTVERSION}
DISTVERSIONPREFIX=enfuse-
WRKSRC=		${WRKDIR}/${DISTNAME}-753b534c819d

MAINTAINER=	ii@any.com.ru
COMMENT=	A tool for image blending with multiresolution splines (developers snapshot)

BUILD_DEPENDS=	${LOCALBASE}/include/boost/pool/pool.hpp:${PORTSDIR}/devel/boost-libs
LIB_DEPENDS=	png:${PORTSDIR}/graphics/png \
		jpeg.11:${PORTSDIR}/graphics/jpeg \
		lcms:${PORTSDIR}/graphics/lcms \
		xmi.1:${PORTSDIR}/graphics/libxmi \
		tiff.4:${PORTSDIR}/graphics/tiff \
		IlmImf.6:${PORTSDIR}/graphics/OpenEXR

GNU_CONFIGURE=	yes
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
		LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

USE_GMAKE=	yes
USE_PERL5_BUILD=yes

MAN1=		enblend.1 enfuse.1
PLIST_FILES=	bin/enblend bin/enfuse

OPTIONS=	IC	"Enable Image Cache support" on \
		OPENMP	"Enable OpenMP support"	off \
		GPU	"Enable GPU support"	off

.include <bsd.port.pre.mk>

.if defined(WITH_IC)
CONFIGURE_ARGS+=--enable-image-cache
.else
CONFIGURE_ARGS+=--disable-image-cache
.endif

.if defined(WITH_OPENMP)
CONFIGURE_ARGS+=--enable-openmp
.else
CONFIGURE_ARGS+=--disable-openmp
.endif

.if defined(WITH_GPU)
CONFIGURE_ARGS+=--enable-gpu-support
USE_GL=		glut
LIB_DEPENDS+=	GLEW.1:${PORTSDIR}/graphics/glew
.else
CONFIGURE_ARGS+=--disable-gpu-support
.endif

.include <bsd.port.post.mk>
