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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

.PHONY: override_dh_auto_configure   \
        override_dh_auto_build-indep \
        override_dh_auto_install     \
        override_dh_auto_test-indep  \
        override_dh_compress         \
        get-source-orig

override_dh_auto_configure:
	dh_auto_configure --  \
	    -DCMAKE_INSTALL_PREFIX:PATH=/usr \
	    -DBUILD_EXAMPLES:BOOL=True \
	    -DBUILD_VISUALIZER:BOOL=True \
	    -DSIMBODY_VISUALIZER_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)/simbody/libexec

override_dh_auto_build-indep:
	dh_auto_build -- doxygen

override_dh_auto_install:
	dh_auto_install --buildsystem=cmake

	# Remove extra LICENSE and INSTALL file
	rm debian/tmp/usr/share/doc/simbody/LICENSE.txt
	rm debian/tmp/usr/share/doc/simbody/CHANGELOG.md

override_dh_compress:
	# Don't compress the .pdf nor source files
	dh_compress -X.pdf -X.cpp -X.h -X.sdf -X.obj -X.txt

# No test can be done without the binaries
override_dh_auto_test-indep:

%:
	dh $@ --buildsystem=cmake