#!/usr/bin/make -f
export QT_SELECT=6

override_dh_auto_configure:
	dh_auto_configure -- \
		-G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
		-DBUILD_TESTS=ON

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build/
	rm -f translations/*.qm
	-find manual -name '*.gz' -delete || true

override_dh_auto_build:
	gzip -kf manual/mx-snapshot.8 manual/iso-snapshot-cli.8
	dh_auto_build
	# Copy exclude list for CLI version
	cp -f mx-snapshot-exclude.list iso-snapshot-cli-exclude.list

override_dh_shlibdeps:
	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info

override_dh_auto_install:
	# Install is handled by debian/install file
	dh_auto_install

%:
	dh $@ --buildsystem=cmake+ninja --no-automatic-dbgsym
