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

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

DEB_CMAKE_EXTRA_FLAGS = \
    -DCMAKE_INSTALL_LOCALSTATEDIR="/var" \
    -DENABLE_TESTS=ON \
    -DENABLE_COVERAGE=OFF \
    $(NULL)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure --builddirectory=build-qt6 -- $(DEB_CMAKE_EXTRA_FLAGS) -DENABLE_QT6=ON
	dh_auto_configure --builddirectory=build-qt5 -- $(DEB_CMAKE_EXTRA_FLAGS) -DENABLE_QT6=OFF

override_dh_auto_build:
	dh_auto_build --builddirectory=build-qt6
	dh_auto_build --builddirectory=build-qt5

override_dh_auto_test:
	dh_auto_test --builddirectory=build-qt6
	dh_auto_test --builddirectory=build-qt5

override_dh_auto_install:
	dh_auto_install --builddirectory=build-qt6
	dh_auto_install --builddirectory=build-qt5

override_dh_auto_clean:
	dh_auto_clean --builddirectory=build-qt6
	dh_auto_clean --builddirectory=build-qt5

override_dh_makeshlibs:
	dh_makeshlibs -Xlibqmenumodel-qml.so

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
