#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export QT_SELECT := 6
export INSTALL_PREFIX  = /usr
export INSTALL_DESTDIR = /debian/imageviewer$(INSTALL_PREFIX)

%:
	dh $@ --buildsystem=qmake6

override_dh_auto_configure:
	find src/ThirdParty/* -maxdepth 1 -mindepth 1 -type d -or -name '*.pro' -exec rm -rfv {} +
	dh_auto_configure -- \
		CONFIG+="release enable_pkgconfig" \
		CONFIG+="system_thirdparty" \
		CONFIG+="disable_libjasper" \
		CONFIG+="disable_libbpg" \
		CONFIG+="disable_flif" \
		INCLUDEPATH+="/usr/include/jxrlib" \
		INCLUDEPATH+="/usr/include/openjpeg-2.5" \
		INCLUDEPATH+="/usr/include/freetype2" \
		INCLUDEPATH+="/usr/include/Imath" \
		-r ImageViewer.pro

override_dh_install:
	dh_install --

override_dh_missing:
	dh_missing --fail-missing
