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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure --builddirectory=build-qt6 -- \
		-DENABLE_QT6=ON \
		-DENABLE_TESTS=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON) \
		-DENABLE_COVERAGE=OFF \
		-DCMAKE_INSTALL_LOCALSTATEDIR="/var" \
		$(NULL)
	dh_auto_configure --builddirectory=build-qt5 -- \
		-DENABLE_QT6=OFF \
		-DENABLE_TESTS=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON) \
		-DENABLE_COVERAGE=OFF \
		-DCMAKE_INSTALL_LOCALSTATEDIR="/var" \
		$(NULL)

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=..
