#!/usr/bin/make -f
# -*- makefile -*-
DPKG_EXPORT_BUILDFLAGS = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export QT_SELECT := qt5
export OPENJPEG_INCLUDE = $(shell find /usr/include/ -name openjpeg.h -exec dirname {} \;)
export POPPLER_INCLUDE := /usr/include/poppler/qt5

%:
	dh $@

override_dh_auto_configure:
	ENGAUGE_RELEASE=1 dh_auto_configure -- engauge.pro CONFIG+=jpeg2000 CONFIG+=pdf

override_dh_auto_build:
	# build documentation
	qcollectiongenerator help/engauge.qhcp -o help/engauge.qhc
	mkdir -p bin/
	mv help/engauge.qhc bin/
	mv help/engauge.qch bin/
	dh_auto_build

#override_dh_clean:
#	rm -rf bin/
#	rm -rf engauge.log
#	dh_clean

#override_dh_install:
#	mkdir -p debian/engauge-digitizer/usr/share/pixmaps/
#	install -m644 src/img/bannerapp_128.xpm debian/engauge-digitizer/usr/share/pixmaps/engauge-digitizer.xpm
#	dh_install
