#!/usr/bin/make -f
# The desktop entry and icons come from upstream (packaging/ in the source
# tree).  The manual is built from doc/manual with pandoc and pdflatex; both
# formats are installed by ctsim-doc into /usr/share/doc/ctsim, where the
# program's Help menu looks (a gzipped PDF is handled).
#
# 7.0.0: the wxWidgets application is gone, so there is no wx build
# dependency and no ctsim-qt -> ctsim symlink; the Qt application is ctsim.

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCTSIM_GUI=qt \
		-DCTSIM_BUILD_TESTS=ON

override_dh_auto_build:
	dh_auto_build
	dh_auto_build -- manual manual-pdf

# dh_auto_test runs ctest, fails the build on its own, and honours
# "nocheck" in DEB_BUILD_OPTIONS; it needs no help.  The tests need a
# display-less Qt, which the offscreen platform provides.
override_dh_auto_test:
	QT_QPA_PLATFORM=offscreen dh_auto_test

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

# Keep the PDF uncompressed: doc viewers open it directly, and the program
# copes with either form.
override_dh_compress:
	dh_compress -X.pdf
