aboutsummaryrefslogtreecommitdiffstats
path: root/devel/gdcm/Makefile
blob: 11eb4401909e0098a54fdfc95c201d87715ce7d5 (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
# Created by: Pietro Cerutti <gahr@FreeBSD.org>
# $FreeBSD$

PORTNAME=   gdcm
PORTVERSION=    ${GDCM_MAJOR}.${GDCM_MINOR}.${GDCM_PATCH}
CATEGORIES= devel
MASTER_SITES=   SF/gdcm/gdcm%202.x/GDCM%20${PORTVERSION}

MAINTAINER= gahr@FreeBSD.org
COMMENT=    Grassroots DICOM library

LIB_DEPENDS=    libopenjpeg.so:${PORTSDIR}/graphics/openjpeg \
        libexpat.so:${PORTSDIR}/textproc/expat2

OPTIONS_DEFINE= DOCS
OPTIONS_UNSET=  DOCS
OPTIONS_RADIO=  VTK
OPTIONS_RADIO_VTK=  VTK5 VTK6
VTK5_DESC=  Build VTK 5 integration classes
VTK6_DESC=  Build VTK 6 integration classes

# Change this when updating the port
GDCM_MAJOR= 2
GDCM_MINOR= 4
GDCM_PATCH= 2

# Change this whenever VTK is updated
VTK5_VERSION=   5.10
VTK6_VERSION=   6.1

USES=       cmake:outsource tar:bzip2
USE_OPENSSL=    yes
USE_LDCONFIG=   ${PREFIX}/lib
CFLAGS+=    -I${LOCALBASE}/include
CMAKE_ARGS+=    -DGDCM_PDF_DOCUMENTATION:BOOL=NO \
        -DGDCM_USE_SYSTEM_OPENSSL:BOOL=YES \
        -DGDCM_USE_SYSTEM_EXPAT:BOOL=YES \
        -DGDCM_USE_SYSTEM_OPENJPEG:BOOL=YES \
        -DGDCM_USE_SYSTEM_ZLIB:BOOL=YES \
        -DGDCM_BUILD_APPLICATIONS:BOOL=YES \
            -DGDCM_BUILD_SHARED_LIBS:BOOL=YES \
        -DGDCM_BUILD_EXAMPLES:BOOL=NO \
        -DGDCM_INSTALL_DATA_DIR:STRING=${DATADIR}

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MVTK5}
LIB_DEPENDS+=   libvtkHybrid.so:${PORTSDIR}/math/vtk5
CMAKE_ARGS+=    -DGDCM_USE_VTK:BOOL=YES \
        -DVTK_DIR:PATH=${LOCALBASE}/lib/vtk-${VTK5_VERSION}
.endif

.if ${PORT_OPTIONS:MVTK6}
LIB_DEPENDS+=   libvtkCommonCore-${VTK6_VERSION}.so:${PORTSDIR}/math/vtk6
CMAKE_ARGS+=    -DGDCM_USE_VTK:BOOL=YES \
        -DVTK_DIR:PATH=${LOCALBASE}/lib/vtk-${VTK6_VERSION}
.endif

.if ${PORT_OPTIONS:MVTK5} || ${PORT_OPTIONS:MVTK6}
PLIST_SUB+= VTK=""
.else
PLIST_SUB+= VTK="@comment " 
.endif

PLIST_SUB+= GDCM_MAJOR="${GDCM_MAJOR}" \
        GDCM_MINOR="${GDCM_MINOR}" \
        GDCM_PATCH="${GDCM_PATCH}"

.if ${PORT_OPTIONS:MDOCS}
USE_TEX=    latex:build
USE_GHOSTSCRIPT=yes
BUILD_DEPENDS+= doxygen:${PORTSDIR}/devel/doxygen
CMAKE_ARGS+=    -DGDCM_DOCUMENTATION:BOOL=YES \
        -DGDCM_INSTALL_MAN_DIR:STRING=man \
        -DGDCM_INSTALL_DOC_DIR:STRING=${DOCSDIR}
PORTDOCS=   *
.else
CMAKE_ARGS+=    -DGDCM_DOCUMENTATION:BOOL=NO
.endif

post-build:
.if ${PORT_OPTIONS:MDOCS}
    cd ${WRKSRC}/Utilities/doxygen && ${LOCALBASE}/bin/doxygen -u doxyfile.in
.endif

.include <bsd.port.mk>