PORTNAME=	soci
DISTVERSIONPREFIX=	v
DISTVERSION=	4.1.2
PORTREVISION=	1
CATEGORIES=	databases

MAINTAINER=	jbo@FreeBSD.org
COMMENT=	C++ Database Access Library
WWW=		https://soci.sourceforge.net/

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

USES=		cmake compiler:c++14-lang

USE_GITHUB=	yes
GH_ACCOUNT=	SOCI

USE_LDCONFIG=	yes

CMAKE_OFF=	SOCI_DB2 SOCI_ORACLE

OPTIONS_DEFINE=		BOOST FIREBIRD MYSQL ODBC PGSQL SQLITE
OPTIONS_DEFAULT=	BOOST FIREBIRD MYSQL ODBC PGSQL SQLITE

# firebird is currently only available on x86.
OPTIONS_EXCLUDE_aarch64=	FIREBIRD
OPTIONS_EXCLUDE_armv6=		FIREBIRD
OPTIONS_EXCLUDE_armv7=		FIREBIRD
OPTIONS_EXCLUDE_mips=		FIREBIRD
OPTIONS_EXCLUDE_mips64=		FIREBIRD
OPTIONS_EXCLUDE_powerpc=	FIREBIRD
OPTIONS_EXCLUDE_powerpc64=	FIREBIRD
OPTIONS_EXCLUDE_powerpc64le=	FIREBIRD
OPTIONS_EXCLUDE_riscv64=	FIREBIRD

OPTIONS_SUB=	yes

BOOST_DESC=		Enable support for additional types using Boost
BOOST_LIB_DEPENDS=	libboost_date_time.so:devel/boost-libs
BOOST_CMAKE_BOOL=	WITH_BOOST

FIREBIRD_USES=		firebird
FIREBIRD_CMAKE_BOOL=	SOCI_FIREBIRD

MYSQL_LIB_DEPENDS=	libunwind.so:devel/libunwind
MYSQL_USES=		mysql ssl
MYSQL_CMAKE_BOOL=	SOCI_MYSQL

ODBC_LIB_DEPENDS=	libodbc.so:databases/unixODBC
ODBC_CMAKE_BOOL=	SOCI_ODBC
ODBC_CMAKE_ON=		-DODBC_LIBRARY:FILE_PATH=${LOCALBASE}/lib/libodbc.so

PGSQL_USES=		pgsql
PGSQL_CMAKE_BOOL=	SOCI_POSTGRESQL

SQLITE_USES=		sqlite
SQLITE_CMAKE_BOOL=	SOCI_SQLITE3

.include <bsd.port.mk>
