#!/usr/bin/make -f

include $(CURDIR)/debian/build-order.make

BUILD_TESTING := $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON)

%:
	dh $@

override_dh_auto_configure:

override_dh_auto_build:

override_dh_auto_test:

override_dh_auto_install:
	set -ex; \
	for module in $(AMENT_MODULES); do \
		CMAKE_PREFIX_PATH=$(CURDIR)/debian/tmp/usr dh_auto_configure --buildsystem=cmake --sourcedir=$$module --builddir=build/$$module -- -DBUILD_TESTING=$(BUILD_TESTING); \
		dh_auto_build --buildsystem=cmake --sourcedir=$$module --builddir=build/$$module; \
		[ "$(BUILD_TESTING)" = "ON" ] || \
		dh_auto_test --buildsystem=cmake --sourcedir=$$module --builddir=build/$$module; \
		dh_auto_install --buildsystem=cmake --sourcedir=$$module --builddir=build/$$module; \
	done
