# $OpenBSD: Makefile.template,v 1.60 2010/10/24 20:41:23 ajacoutot Exp $

COMMENT =		tile map editor

DISTNAME =		tiled-qt-0.8.1
PKGNAME =		${DISTNAME:S/-qt//}

SHARED_LIBS +=		tiled                     0.0 # 1.0

CATEGORIES =		editors games

HOMEPAGE =		http://www.mapeditor.org/

# GPLv2+
PERMIT_PACKAGE_CDROM =		Yes
PERMIT_PACKAGE_FTP =		Yes
PERMIT_DISTFILES_CDROM =	Yes
PERMIT_DISTFILES_FTP =		Yes

WANTLIB +=	GL GLU ICE QtGui QtOpenGL SM X11 Xext Xi Xinerama Xrender
WANTLIB +=	c fontconfig freetype m pthread stdc++ z

MASTER_SITES =		${MASTER_SITE_SOURCEFORGE:=tiled/}

MODULES =		x11/qt4

MAKE_FLAGS =		CC="${CC}" CXX="${CXX}" PREFIX="${PREFIX}" \
			LIBtiled_VERSION="${LIBtiled_VERSION}"
FAKE_FLAGS =		INSTALL_ROOT="${DESTDIR}"

do-build:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} qmake4 -makefile tiled.pro && \
		${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
		-f ${MAKE_FILE} ${ALL_TARGET}

do-regress:
	cd ${WRKSRC}/tests && ${SETENV} ${MAKE_ENV} qmake4 \
		-makefile test_mapreader.pro && \
		${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} \
		-f ${MAKE_FILE} ${ALL_TARGET} && ./test_mapreader

.include <bsd.port.mk>
