aboutsummaryrefslogtreecommitdiff
path: root/graphics/opennurbs/Makefile
blob: 84aae7b175017938a6f2d8128f4a5c6f1d4b7523 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
PORTNAME=	opennurbs
PORTVERSION=	20130711
PORTREVISION=	3
CATEGORIES=	graphics
MASTER_SITES=	http://files.na.mcneel.com/opennurbs/5.0/2013-07-11/
DISTNAME=	${PORTNAME}_${PORTVERSION}

MAINTAINER=	fernape@FreeBSD.org
COMMENT=	Tools to accurately transfer 3-D geometry between applications

LICENSE_FILE=	${WRKSRC}/readme.txt

USES=		iconv:build dos2unix gmake zip
MAKE_ARGS=	CC="${CC}" CCC="${CXX}"

MAKEFILE=	makefile

OPTIONS_DEFINE=	EXAMPLES

.include <bsd.port.pre.mk>

# In r311275 zlib.h was moved to contrib/zlib/zlib.h from lib/libz/zlib.h
LIBZ=		${SRC_BASE}/contrib/zlib
.if !exists(${LIBZ}/zlib.h)
LIBZ=		${SRC_BASE}/sys/contrib/zlib
.endif
.if !exists(${LIBZ}/zlib.h)
LIBZ:=		${SRC_BASE}/lib/libz
.endif
.if !exists(${LIBZ}/zlib.h)
IGNORE=		needs SRC_BASE to compile. Install base system sources and try again
.endif

.if ${ARCH} != i386
MAKE_ARGS+=	ON_GNU_OPTIMIZER_FLAGS="-g -fPIC"
.endif

pre-build:
	@${RM} -r ${WRKSRC}/zlib
	${CP} -R ${LIBZ} ${WRKSRC}/zlib

do-install:
	@${MKDIR} ${STAGEDIR}${PREFIX}/include/openNURBS/zlib
	${INSTALL_DATA} ${WRKSRC}/libopenNURBS.a ${STAGEDIR}${PREFIX}/lib
	${INSTALL_DATA} ${WRKSRC}/*.h ${STAGEDIR}${PREFIX}/include/openNURBS
	${INSTALL_DATA} ${WRKSRC}/zlib/*.h \
		${STAGEDIR}${PREFIX}/include/openNURBS/zlib

do-install-EXAMPLES-on:
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/examples_linking_pragmas.h \
		${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/opennurbs.h ${STAGEDIR}${EXAMPLESDIR}
.for i in brep read roundtrip userdata write
	@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/example_${i}
	${INSTALL_PROGRAM} ${WRKSRC}/example_${i}/example_${i} ${STAGEDIR}${EXAMPLESDIR}/example_${i}
	cd ${WRKSRC}/example_${i} && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}/example_${i} "-name *\.cpp -or -name *\.h"
.endfor

.include <bsd.port.post.mk>