#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

OBJ_DIR = obj-$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
include /usr/share/dpkg/default.mk

%:
	dh $@ --buildsystem=cmake

# Run tests that don't require internet during build
override_dh_auto_test:
	cd $(OBJ_DIR)/tests && ctest -L offline

override_dh_auto_configure:
	dh_auto_configure -- -DJSON_MultipleHeaders=ON -DCMAKE_INSTALL_LIBDIR=lib

execute_before_dh_auto_clean:
	sed -e 's/@VERSION@/$(DEB_VERSION_UPSTREAM)/' debian/control.in > debian/control
	sed -e 's/@VERSION@/$(DEB_VERSION_UPSTREAM)/' debian/nlohmann-json3-dev-substvars.in > debian/nlohmann-json3-dev-substvars
