#!/usr/bin/make -f
#export DH_VERBOSE=1

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DBUILD_SHARED_LIBS=on \
		-DBUILD_EXTRAS=on \
		-DBUILD_BULLET2_DEMOS=off \
		-DBUILD_OPENGL3_DEMOS=off \
		-DBUILD_CPU_DEMOS=off \
		-DINSTALL_LIBS=on \
		-DINSTALL_EXTRA_LIBS=on \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH)

override_dh_auto_build-indep:
	# Build the documentation without TIMESTAMPS and make the build
	# reproducible
	( cat Doxyfile ; echo "HTML_TIMESTAMP=NO" ) | doxygen -
	$(RM) -v html/*.md5 html/*.map
	# De-duplication (http://wiki.debian.org/dedup.debian.net):
	rdfind -outputname /dev/null -makesymlinks true html
	symlinks -rsc html

override_dh_auto_test-indep:
	# Do nothing here to prevent a FTBFS

override_dh_compress:
	dh_compress --exclude=.pdf

override_dh_clean:
	dh_clean
	$(RM) doxygen_sqlite3.db
	$(RM) -r html

get-orig-source:
	uscan --verbose --repack --download-current-version --force-download --compression xz
