#!/usr/bin/make -f

DH_VERBOSE := 1
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -DCMAKE_BUILD_TYPE="RelWithDebug" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 # -DWITH_LIBCDS="1"

override_dh_auto_build:
	dh_auto_build
	$(MAKE) -C obj-$$(dpkg-architecture -qDEB_TARGET_GNU_TYPE) doc

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	echo "I: Executing benchmark - who knows how to execute it properly?"
	obj-$$(dpkg-architecture -qDEB_TARGET_GNU_TYPE)/benchmark || true
	echo "I: gtest"
	obj-$$(dpkg-architecture -qDEB_TARGET_GNU_TYPE)/gtest
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/html/
