aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authoradamw <adamw@FreeBSD.org>2016-07-01 04:02:43 +0800
committeradamw <adamw@FreeBSD.org>2016-07-01 04:02:43 +0800
commite2c38d6eca246ad91055de2bdaebfe5cff447454 (patch)
tree8b3e22b054d084e34040e8656cb76f2f6fb806d0 /math
parentd90aa13c71b179143abbc37e521b47c33b9077c9 (diff)
downloadfreebsd-ports-graphics-e2c38d6eca246ad91055de2bdaebfe5cff447454.tar.gz
freebsd-ports-graphics-e2c38d6eca246ad91055de2bdaebfe5cff447454.tar.zst
freebsd-ports-graphics-e2c38d6eca246ad91055de2bdaebfe5cff447454.zip
Convert a couple ports that use both _CMAKE_ON and _CMAKE_OFF to _CMAKE_BOOL.
Use options helpers all the way in math/carve, because I couldn't help myself.
Diffstat (limited to 'math')
-rw-r--r--math/carve/Makefile15
-rw-r--r--math/vtk5/Makefile56
2 files changed, 24 insertions, 47 deletions
diff --git a/math/carve/Makefile b/math/carve/Makefile
index 46fb2c9a1e0..275fd8fbe4a 100644
--- a/math/carve/Makefile
+++ b/math/carve/Makefile
@@ -15,6 +15,7 @@ LICENSE= GPLv2
LIB_DEPENDS= libboost_filesystem.so:devel/boost-libs
OPTIONS_DEFINE= DOCS GUI
+OPTIONS_SUB= yes
USES= cmake:outsource compiler:c++11-lib tar:tgz
USE_GL= glut
@@ -26,17 +27,9 @@ CFLAGS+= -I${LOCALBASE}/include
CXXFLAGS+= -std=c++11
LDFLAGS+= -L${LOCALBASE}/lib
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MGUI}
-LIB_DEPENDS+= libglui.so:devel/glui
-PLIST_SUB+= GUI=""
-CMAKE_ARGS+= -DCARVE_WITH_GUI:BOOL=true
-.else
-CONFIGURE_ARGS+=--with-gui=no
-PLIST_SUB+= GUI="@comment "
-CMAKE_ARGS+= -DCARVE_WITH_GUI:BOOL=false
-.endif
+GUI_LIB_DEPENDS= libglui.so:devel/glui
+GUI_CONFIGURE_OFF= --with-gui=no
+GUI_CMAKE_BOOL= CARVE_WITH_GUI
post-patch:
${FIND} ${WRKSRC} -name "*.cpp" -o -name "*.h" -o -name "*.hpp" | ${XARGS} \
diff --git a/math/vtk5/Makefile b/math/vtk5/Makefile
index bb86d483caf..14d4aa4ed6d 100644
--- a/math/vtk5/Makefile
+++ b/math/vtk5/Makefile
@@ -57,24 +57,28 @@ CMAKE_ARGS+= -DBUILD_DOCUMENTATION:BOOL=ON \
-DOPENGL_gl_LIBRARY:FILEPATH=${LOCALBASE}/lib/libGL.so \
-DOPENGL_glu_LIBRARY:FILEPATH=${LOCALBASE}/lib/libGLU.so
+SHARED_CMAKE_BOOL= BUILD_SHARED_LIBS
+.for lib in EXPAT JPEG PNG TIFF ZLIB
+SHARED_CMAKE_BOOL+= VTK_USE_SYSTEM_${lib}
+.endfor
+
+VTKMPEG2_CMAKE_BOOL= VTK_USE_PATENTED VTK_USE_MPEG2_ENCODER
+THEORA_CMAKE_BOOL= VTK_USE_OGGTHEORA_ENCODER
+GL2PS_CMAKE_BOOL= GTK_USE_GL2PS
+OSMESA_CMAKE_BOOL= VTK_OPENGL_HAS_OSMESA
+OSMESA_CMAKE_BOOL_OFF= VTK_USE_X
+QT4_CMAKE_BOOL= VTK_USE_GUISUPPORT
+TCLTK_CMAKE_BOOL= VTK_WRAP_TCL
+DBGLEAKS_CMAKE_BOOL= VTK_DEBUG_LEAKS
+LEGACY_CMAKE_BOOL_OFF= VTK_LEGACY_REMOVE
+
+
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MSHARED}
-CMAKE_ARGS+= -DBUILD_SHARED_LIBS:BOOL=ON \
- -DVTK_USE_SYSTEM_EXPAT:BOOL=ON \
- -DVTK_USE_SYSTEM_JPEG:BOOL=ON \
- -DVTK_USE_SYSTEM_PNG:BOOL=ON \
- -DVTK_USE_SYSTEM_TIFF:BOOL=ON \
- -DVTK_USE_SYSTEM_ZLIB:BOOL=ON
PLIST_SUB+= SHARED="" \
STATIC="@comment "
.else
-CMAKE_ARGS+= -DBUILD_SHARED_LIBS:BOOL=OFF \
- -DVTK_USE_SYSTEM_EXPAT:BOOL=OFF \
- -DVTK_USE_SYSTEM_JPEG:BOOL=OFF \
- -DVTK_USE_SYSTEM_PNG:BOOL=OFF \
- -DVTK_USE_SYSTEM_TIFF:BOOL=OFF \
- -DVTK_USE_SYSTEM_ZLIB:BOOL=OFF
PLIST_SUB+= SHARED="@comment " \
STATIC=""
.endif
@@ -82,9 +86,7 @@ PLIST_SUB+= SHARED="@comment " \
.if ${PORT_OPTIONS:MVTKMPEG2}
LIB_DEPENDS+= libvtkMPEG2Encode.so:multimedia/vtkmpeg2encode
PLIST_SUB+= MPEG=""
-CMAKE_ARGS+= -DVTK_USE_PATENTED:BOOL=ON \
- -DVTK_USE_MPEG2_ENCODER:BOOL=ON \
- -DvtkMPEG2Encode_INCLUDE_PATH=${LOCALBASE}/include/vtk-${PORTVERSION:R} \
+CMAKE_ARGS+= -DvtkMPEG2Encode_INCLUDE_PATH=${LOCALBASE}/include/vtk-${PORTVERSION:R} \
-DvtkMPEG2Encode_LIBRARIES=${LOCALBASE}/lib/libvtkMPEG2Encode.so
.else
PLIST_SUB+= MPEG="@comment "
@@ -94,15 +96,12 @@ PLIST_SUB+= MPEG="@comment "
LIB_DEPENDS+= libogg.so:audio/libogg \
libtheora.so:multimedia/libtheora
PLIST_SUB+= THEORA=""
-CMAKE_ARGS+= -DVTK_USE_OGGTHEORA_ENCODER:BOOL=ON
.else
PLIST_SUB+= THEORA="@comment "
-CMAKE_ARGS+= -DVTK_USE_OGGTHEORA_ENCODER:BOOL=OFF
.endif
.if ${PORT_OPTIONS:MGL2PS}
LIB_DEPENDS+= libgl2ps.so:print/gl2ps
-CMAKE_ARGS+= -DVTK_USE_GL2PS:BOOL=ON
PLIST_SUB+= GL2PS=""
.else
PLIST_SUB+= GL2PS="@comment "
@@ -110,30 +109,25 @@ PLIST_SUB+= GL2PS="@comment "
.if ${PORT_OPTIONS:MOSMESA}
LIB_DEPENDS+= libOSMesa.so:graphics/libosmesa
-CMAKE_ARGS+= -DVTK_OPENGL_HAS_OSMESA:BOOL=ON \
- -DOSMESA_INCLUDE_DIR:PATH=${LOCALBASE}/include/Mesa \
+CMAKE_ARGS+= -DOSMESA_INCLUDE_DIR:PATH=${LOCALBASE}/include/Mesa \
-DOSMESA_LIBRARY:FILEPATH=${LOCALBASE}/lib/libOSMesa.so \
- -DOPENGL_gl_LIBRARY:FILEPATH=${LOCALBASE}/lib/libOSMesa.so \
- -DVTK_USE_X:BOOL=OFF
+ -DOPENGL_gl_LIBRARY:FILEPATH=${LOCALBASE}/lib/libOSMesa.so
PLIST_SUB+= X11="@comment "
.else
USE_GL= yes
-CMAKE_ARGS+= -DVTK_USE_X:BOOL=ON
PLIST_SUB+= X11=""
.endif
.if ${PORT_OPTIONS:MQT4}
USE_QT4= corelib designer gui opengl qmake_build uic_build \
moc_build rcc_build
-CMAKE_ARGS+= -DVTK_USE_GUISUPPORT:BOOL=ON \
- -DVTK_USE_QVTK:BOOL=ON \
+CMAKE_ARGS+= -DVTK_USE_QVTK:BOOL=ON \
-DVTK_USE_QT:BOOL=ON \
-DDESIRED_QT_VERSION:STRING=4 \
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QMAKE} \
-DVTK_INSTALL_QT_DIR:FILEPATH=/lib/qt4/plugins/designer
PLIST_SUB+= QT=""
.else
-CMAKE_ARGS+= -DVTK_USE_GUISUPPORT:BOOL=OFF
PLIST_SUB+= QT="@comment "
.endif
@@ -157,10 +151,8 @@ PLIST_SUB+= PYTHON="@comment "
.endif
.if ${PORT_OPTIONS:MTCLTK}
-CMAKE_ARGS+= -DVTK_WRAP_TCL:BOOL=ON
PLIST_SUB+= TCLTK=""
.else
-CMAKE_ARGS+= -DVTK_WRAP_TCL:BOOL=OFF
PLIST_SUB+= TCLTK="@comment "
.endif
@@ -206,17 +198,9 @@ PLIST_SUB+= WRAPPING=""
PLIST_SUB+= WRAPPING="@comment "
.endif
-.if ${PORT_OPTIONS:MDBGLEAKS}
-CMAKE_ARGS+= -DVTK_DEBUG_LEAKS:BOOL=ON
-.else
-CMAKE_ARGS+= -DVTK_DEBUG_LEAKS:BOOL=OFF
-.endif
-
.if ${PORT_OPTIONS:MLEGACY}
-CMAKE_ARGS+= -DVTK_LEGACY_REMOVE:BOOL=OFF
PLIST_SUB+= LEGACY=""
.else
-CMAKE_ARGS+= -DVTK_LEGACY_REMOVE:BOOL=ON
PLIST_SUB+= LEGACY="@comment "
.endif