#!/usr/bin/make -f
%:
	dh $@ --buildsystem=cmake  --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure -- \
				-DSPIRV_REFLECT_BUILD_TESTS="ON"

override_dh_auto_build:
	# Generate the manpages
	dh_auto_build
	help2man --name="SPIRV-Reflect" --version-string="$(shell dpkg-parsechangelog -S Version | sed 's/-.*//')" bin/spirv-reflect > spirv-reflect.1
	help2man --name="SPIRV-Reflect" --version-string="$(shell dpkg-parsechangelog -S Version | sed 's/-.*//')" bin/spirv-reflect-pp > spirv-reflect-pp.1

override_dh_auto_test:
	# Run the tests included in the package, they are not triggered by default
	(cd build && ./test-spirv-reflect)
	dh_auto_test
