aboutsummaryrefslogtreecommitdiffstats
path: root/databases/soci/Makefile
blob: c9cbd1555a6ae25e3dcf6e1b325df8bcdf07705c (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
# Created by: Julien Laffaye <kimelto@gmail.com>
# $FreeBSD$

PORTNAME=   soci
PORTVERSION=    3.1.0
CATEGORIES= databases
MASTER_SITES=   SF
MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}

MAINTAINER= jlaffaye@FreeBSD.org
COMMENT=    The C++ Database Access Library

LICENSE=    BSL
LICENSE_FILE=   ${WRKSRC}/LICENSE_1_0.txt

USE_ZIP=    yes
USES=       cmake
CMAKE_ARGS+=    -DWITH_ORACLE:BOOL=OFF
MAKE_JOBS_SAFE= yes
USE_LDCONFIG=   yes

SUB_FILES=  pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message

OPTIONS_DEFINE= MYSQL PGSQL SQLITE ODBC BOOST
BOOST_DESC= Enable support for additional types using Boost
OPTIONS_SINGLE= ODBCDRV
ODBCDRV_DESC=   ODBC driver to use
OPTIONS_SINGLE_ODBCDRV= IODBC UODBC
IODBC_DESC= use iODBC driver
UODBC_DESC= use unixODBC driver
OPTIONS_DEFAULT=MYSQL PGSQL SQLITE ODBC IODBC BOOST

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=  yes
PLIST_SUB+= MYSQL=""
CMAKE_ARGS+=    -DWITH_MYSQL:BOOL=ON
.else
PLIST_SUB+= MYSQL="@comment "
CMAKE_ARGS+=    -DWITH_MYSQL:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MPGSQL}
USE_PGSQL=  yes
PLIST_SUB+= PGSQL=""
CMAKE_ARGS+=    -DWITH_POSTGRESQL:BOOL=ON
.else
PLIST_SUB+= PGSQL="@comment "
CMAKE_ARGS+=    -DWITH_POSTGRESQL:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MSQLITE}
USE_SQLITE= yes
PLIST_SUB+= SQLITE=""
CMAKE_ARGS+=    -DWITH_SQLITE3:BOOL=ON
.else
PLIST_SUB+= SQLITE="@comment "
CMAKE_ARGS+=    -DWITH_SQLITE3:BOOL=OFF
.endif

.if ${PORT_OPTIONS:MODBC}
PLIST_SUB+= ODBC=""
CMAKE_ARGS+=    -DWITH_ODBC:BOOL=ON
.if ${PORT_OPTIONS:MUODBC}
LIB_DEPENDS+=   odbc:${PORTSDIR}/databases/unixODBC
CMAKE_ARGS+=    -DODBC_LIBRARY:FILE_PATH=${LOCALBASE}/lib/libodbc.so
.elif ${PORT_OPTIONS:MIODBC}
LIB_DEPENDS+=   iodbc:${PORTSDIR}/databases/libiodbc
CMAKE_ARGS+=    -DODBC_LIBRARY:FILE_PATH=${LOCALBASE}/lib/libiodbc.so
.endif
.else
PLIST_SUB+= ODBC="@comment "
CMAKE_ARGS+=    -DWITH_ODBC:BOOL=OFF
.endif

. if ${PORT_OPTIONS:MBOOST}
LIB_DEPENDS+=   boost_date_time:${PORTSDIR}/devel/boost-libs
PLIST_SUB+= BOOST=""
CMAKE_ARGS+=    -DWITH_BOOST:BOOL=ON
.else
PLIST_SUB+= BOOST="@comment "
CMAKE_ARGS+=    -DWITH_BOOST:BOOL=OFF
.endif

post-install:
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>