#!/usr/bin/make -f
# -*- makefile -*-
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Multiarch (if supported). Required for precise
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

# Configuration flags.
CONFIGURE_ARGS=
 
# If multiarch is supported, override CMAKE_INSTALL_LIB
ifneq ($(DEB_HOST_MULTIARCH),)
CONFIGURE_ARGS+=-DCMAKE_INSTALL_LIBDIR:STRING="lib/${DEB_HOST_MULTIARCH}"
endif

.PHONY: override_dh_auto_configure override_dh_auto_test

%:
	dh $@ --parallel

# https://bitbucket.org/ignitionrobotics/ign-msgs/issues/32/initpointcloudpacked-test-failed-on-i386
override_dh_auto_test:
ifeq ($(DEB_HOST_ARCH),i386)
	true
else
	dh_auto_test
endif

override_dh_auto_configure:
	dh_auto_configure -- \
	    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
            $(CONFIGURE_ARGS)
