#!/usr/bin/make -f

EXTRA_CMAKE_VARIABLES = \
	CMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON \
	RANGES_NATIVE=OFF \
	RANGES_VERBOSE_BUILD=ON

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(EXTRA_CMAKE_VARIABLES:%=-D%)

# Range-v3 is header library so we should make only online documentation unless
# the `nodoc` flag is specified.
override_dh_auto_build:
ifeq (,$(filter nodoc, $(DEB_BUILD_OPTIONS)))
	dh_auto_build -- doc
endif

# The `test` target doesn't compile tests by itself and fails if they aren't
# built before.
override_dh_auto_test:
ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
	dh_auto_build
	dh_auto_test
endif
