aboutsummaryrefslogtreecommitdiff
path: root/graphics/cegui/Makefile
blob: c7846cbe6045dea7cbe18e841b7bc62fdd7508b0 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Created by: Oliver Lehmann <oliver@FreeBSD.org>

PORTNAME=	cegui
PORTVERSION=	0.8.7
PORTREVISION=	19
CATEGORIES=	graphics devel
MASTER_SITES=	SF/crayzedsgui/CEGUI%20Mk-2/0.8

MAINTAINER=	oliver@FreeBSD.org
COMMENT=	Library providing windowing and widgets for graphics APIs

LICENSE=	MIT

WRKSRC=		${WRKDIR}/${DISTNAME:S/2b/2/}
CONFIGURE_ENV+=	TOLUA_INC="${LUA_INCDIR}"
CMAKE_ARGS=	-DCEGUI_SAMPLES_ENABLED:BOOL=OFF \
		-DCEGUI_BUILD_TESTS=OFF
USE_LDCONFIG=	yes
USES=		cmake compiler:c++11-lib iconv localbase pkgconfig tar:bzip2

PORTDOCS=	*

OPTIONS_DEFINE=	FREETYPE PCRE LUA FRIBIDI DOCS
OPTIONS_GROUP=	XMLPARSER IMAGECODEC RENDERER
OPTIONS_GROUP_XMLPARSER=	EXPAT XERCES LIBXML2 RAPIDXML TINYXML
OPTIONS_GROUP_IMAGECODEC=	DEVIL FREEIMAGE SDL2
OPTIONS_GROUP_RENDERER=	OPENGL OPENGL3 OGRE IRRLICHT

OPTIONS_DEFAULT=	FREETYPE PCRE LUA FRIBIDI
OPTIONS_DEFAULT+=	EXPAT LIBXML2 TINYXML
OPTIONS_DEFAULT+=	DEVIL FREEIMAGE SDL2
OPTIONS_DEFAULT+=	OPENGL OPENGL3 OGRE

OPTIONS_SUB=	yes

FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2
FREETYPE_CMAKE_ON=	-DCEGUI_HAS_FREETYPE=ON
FREETYPE_CMAKE_OFF=	-DCEGUI_HAS_FREETYPE=OFF
PCRE_LIB_DEPENDS=	libpcre.so:devel/pcre
PCRE_CMAKE_ON=		-DCEGUI_HAS_PCRE_REGEX=ON
PCRE_CMAKE_OFF=		-DCEGUI_HAS_PCRE_REGEX=OFF
LUA_USES=		lua:51
LUA_LIB_DEPENDS=	libtolua++-${LUA_VER}.so:lang/tolua++
LUA_CMAKE_ON=		-DCEGUI_BUILD_LUA_MODULE=ON -DCEGUI_BUILD_LUA_GENERATOR=ON
LUA_CMAKE_OFF=		-DCEGUI_BUILD_LUA_MODULE=OFF -DCEGUI_BUILD_LUA_GENERATOR=OFF
FRIBIDI_LIB_DEPENDS=	libfribidi.so:converters/fribidi
FRIBIDI_CMAKE_ON=	-DCEGUI_USE_FRIBIDI=ON
FRIBIDI_CMAKE_OFF=	-DCEGUI_USE_FRIBIDI=OFF

EXPAT_LIB_DEPENDS=	libexpat.so:textproc/expat2
EXPAT_CMAKE_ON=		-DCEGUI_BUILD_XMLPARSER_EXPAT=ON
EXPAT_CMAKE_OFF=	-DCEGUI_BUILD_XMLPARSER_EXPAT=OFF
XERCES_LIB_DEPENDS=	libxerces-c.so.3:textproc/xerces-c3
XERCES_CMAKE_ON=	-DCEGUI_BUILD_XMLPARSER_XERCES=ON
XERCES_CMAKE_OFF=	-DCEGUI_BUILD_XMLPARSER_XERCES=OFF
LIBXML2_USES=		gnome
LIBXML2_USE=		GNOME=libxml2
LIBXML2_CMAKE_ON=	-DCEGUI_BUILD_XMLPARSER_LIBXML2=ON
LIBXML2_CMAKE_OFF=	-DCEGUI_BUILD_XMLPARSER_LIBXML2=OFF
RAPIDXML_BUILD_DEPENDS=	${LOCALBASE}/include/rapidxml.hpp:textproc/rapidxml
RAPIDXML_DESC=		XML parser support via RapidXML
RAPIDXML_CMAKE_ON=	-DCEGUI_BUILD_XMLPARSER_RAPIDXML=ON
RAPIDXML_CMAKE_OFF=	-DCEGUI_BUILD_XMLPARSER_RAPIDXML=OFF
TINYXML_LIB_DEPENDS=	libtinyxml.so:textproc/tinyxml
TINYXML_CMAKE_ON=	-DCEGUI_BUILD_XMLPARSER_TINYXML=ON
TINYXML_CMAKE_OFF=	-DCEGUI_BUILD_XMLPARSER_TINYXML=OFF

DEVIL_DESC=		DevIL based ImageCodec module
DEVIL_LIB_DEPENDS=	libIL.so:graphics/devil
DEVIL_CMAKE_ON=		-DCEGUI_BUILD_IMAGECODEC_DEVIL=ON
DEVIL_CMAKE_OFF=	-DCEGUI_BUILD_IMAGECODEC_DEVIL=OFF
FREEIMAGE_DESC=		FreeImage based ImageCodec module
FREEIMAGE_LIB_DEPENDS=	libfreeimage.so:graphics/freeimage
FREEIMAGE_CMAKE_ON=	-DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=ON
FREEIMAGE_CMAKE_OFF=	-DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=OFF
SDL2_DESC=		SDL2 based ImageCodec module
SDL2_USES=		sdl
SDL2_USE=		SDL=sdl2,image2
SDL2_CMAKE_ON=		-DCEGUI_BUILD_IMAGECODEC_SDL2=ON
SDL2_CMAKE_OFF=		-DCEGUI_BUILD_IMAGECODEC_SDL2=OFF

OGRE_DESC=		Ogre3D support
OGRE_LIB_DEPENDS=	libOgreMain.so:graphics/ogre3d19
OGRE_CMAKE_ON=		-DCEGUI_BUILD_RENDERER_OGRE=ON
OGRE_CMAKE_OFF=		-DCEGUI_BUILD_RENDERER_OGRE=OFF
IRRLICHT_DESC=		Irrlicht support
IRRLICHT_LIB_DEPENDS=	libIrrlicht.so:x11-toolkits/irrlicht
IRRLICHT_CMAKE_ON=	-DCEGUI_BUILD_RENDERER_IRRLICHT=ON
IRRLICHT_CMAKE_OFF=	-DCEGUI_BUILD_RENDERER_IRRLICHT=OFF
OPENGL_BUILD_DEPENDS=	${LOCALBASE}/include/glm/glm.hpp:math/glm
OPENGL_USES=		gl
OPENGL_USE=		GL=gl,glew,glu
OPENGL_CMAKE_ON=	-DCEGUI_BUILD_RENDERER_OPENGL=ON
OPENGL_CMAKE_OFF=	-DCEGUI_BUILD_RENDERER_OPENGL=OFF
OPENGL3_DESC=		OpenGL 3+ support (core profile)
OPENGL3_BUILD_DEPENDS=	${OPENGL_BUILD_DEPENDS}
OPENGL3_USES=		${OPENGL_USES}
OPENGL3_USE=		${OPENGL_USE}
OPENGL3_CMAKE_ON=	-DCEGUI_BUILD_RENDERER_OPENGL3=ON
OPENGL3_CMAKE_OFF=	-DCEGUI_BUILD_RENDERER_OPENGL3=OFF

# not present in ports/unsupported, but may appear later
CMAKE_ARGS+=		-DCEGUI_HAS_MINIZIP_RESOURCE_PROVIDER=OFF \
			-DCEGUI_BUILD_IMAGECODEC_CORONA=OFF \
			-DCEGUI_BUILD_IMAGECODEC_SILLY=OFF \
			-DCEGUI_BUILD_IMAGECODEC_PVR=OFF \
			-DCEGUI_BUILD_RENDERER_OPENGLES=OFF \
			-DCEGUI_BUILD_RENDERER_DIRECTFB=OFF
CMAKE_ARGS+=		-DCEGUI_BUILD_PYTHON_MODULES=OFF # python support doesn't build

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MEXPAT} || ${PORT_OPTIONS:MXERCES} || ${PORT_OPTIONS:MLIBXML2} || ${PORT_OPTIONS:MRAPIDXML} || ${PORT_OPTIONS:MTINYXML}
PLIST_SUB+=	XMLPARSERS=""
.else
PLIST_SUB+=	XMLPARSERS="@comment "
.endif

.if ${PORT_OPTIONS:MOPENGL} || ${PORT_OPTIONS:MOPENGL3}
PLIST_SUB+=	ANYOPENGL=""
.else
PLIST_SUB+=	ANYOPENGL="@comment "
.endif

post-patch:
	@${REINPLACE_CMD} -e 's|\$${CEGUI_LIB_INSTALL_DIR}/pkgconfig|libdata/pkgconfig|g' \
		${WRKSRC}/CMakeLists.txt

.include <bsd.port.post.mk>