#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_SKIP_RPATH=1 \
		-DBUILD_USER_MANUAL=1

	# Ensure that the fop.xconf file is found in the DC* files
	# that are located in $(CURDIR)/doc/user-manual

	cd doc/user-manual && \
		sed -i 's|/home/rusconi/devel/xtpcpp/development/doc/user-manual/fop.xconf|$(CURDIR)/doc/user-manual/fop.xconf|' DC-user-manual
		
override_dh_auto_build:
	dh_auto_build --no-parallel

