aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/cegui/Makefile
blob: e20713f14ef6d1596abb739177191b2e626a52f5 (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>
# $FreeBSD$

PORTNAME=   cegui
PORTVERSION=    0.8.4
CATEGORIES= graphics devel
MASTER_SITES=   SF
MASTER_SITE_SUBDIR= crayzedsgui/CEGUI%20Mk-2/0.8

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

LICENSE=    MIT

LIB_DEPENDS=    libexecinfo.so:${PORTSDIR}/devel/libexecinfo

WRKSRC=     ${WRKDIR}/${DISTNAME:S/2b/2/}
CMAKE_ENV+= TOLUA_INC="${LUA_INCDIR}"
CMAKE_ARGS= -DCEGUI_SAMPLES_ENABLED:BOOL=OFF \
        -DCEGUI_BUILD_TESTS=OFF
USE_LDCONFIG=   yes
USES=       compiler:c++11-lib cmake pathfix 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
OPTIONS_GROUP_RENDERER= OPENGL OPENGL3 OGRE IRRLICHT

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

OPTIONS_SUB=    yes

FREETYPE_LIB_DEPENDS=   libfreetype.so:${PORTSDIR}/print/freetype2
FREETYPE_CMAKE_ON=  -DCEGUI_HAS_FREETYPE=ON
FREETYPE_CMAKE_OFF= -DCEGUI_HAS_FREETYPE=OFF
PCRE_LIB_DEPENDS=   libpcre.so:${PORTSDIR}/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:${PORTSDIR}/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
# this option is not currently used as it doesn't compile (see also CMAKE_ARGS below)
PYTHON_USES=        python
PYTHON_LIB_DEPENDS= libboost_python.so:${PORTSDIR}/devel/boost-python-libs
PYTHON_CMAKE_ON=    -DCEGUI_BUILD_PYTHON_MODULES=ON
PYTHON_CMAKE_OFF=   -DCEGUI_BUILD_PYTHON_MODULES=OFF
FRIBIDI_LIB_DEPENDS=    libfribidi.so:${PORTSDIR}/converters/fribidi
FRIBIDI_CMAKE_ON=   -DCEGUI_USE_FRIBIDI=ON
FRIBIDI_CMAKE_OFF=  -DCEGUI_USE_FRIBIDI=OFF

EXPAT_LIB_DEPENDS=  libexpat.so:${PORTSDIR}/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:${PORTSDIR}/textproc/xerces-c3
XERCES_CMAKE_ON=    -DCEGUI_BUILD_XMLPARSER_XERCES=ON
XERCES_CMAKE_OFF=   -DCEGUI_BUILD_XMLPARSER_XERCES=OFF
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:${PORTSDIR}/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:${PORTSDIR}/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:${PORTSDIR}/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:${PORTSDIR}/graphics/freeimage
FREEIMAGE_CMAKE_ON= -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=ON
FREEIMAGE_CMAKE_OFF=    -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=OFF

OGRE_DESC=      Ogre3D support
OGRE_LIB_DEPENDS=   libOgreMain.so:${PORTSDIR}/graphics/ogre3d
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:${PORTSDIR}/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:${PORTSDIR}/math/glm
OPENGL_USE=     GL=gl,glew
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_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>