#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DH_VERBOSE = 1
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

ifeq (,$(filter libtrantor-doc,$(shell dh_listpackages)))
    DOC = OFF
else
    DOC = ON
endif

# Change the builddirectory as doxygen puts the docs there and using a glob to
# avoid arch shenanigans is... eh
%:
	dh $@ --with=cmake --builddirectory=_build

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DBUILD_DOC=$(DOC)

override_dh_missing:
	dh_missing --fail-missing
