#!/usr/bin/make -f
# -*- makefile -*-

DEBUGFLAG = -g
ifeq ($(DEB_BUILD_ARCH_BITS), $(DEB_HOST_ARCH_BITS))
  ifeq ($(DEB_BUILD_ARCH_BITS), 32)
    DEBUGFLAG =
  endif
endif

export CXXFLAGS=$(DEBUGFLAG) -O2 -std=c++11
export OMPI_MCA_orte_rsh_agent=/bin/false

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- 		\
		-DMPI_C_COMPILER=mpicc	\
		-DMPQC_NEW_FEATURES=1	\
		-DBOOST=/usr

override_dh_auto_install:
	dh_auto_install
	mv $(CURDIR)/debian/tmp/usr/bin/mpqc \
	   $(CURDIR)/debian/tmp/usr/bin/mpqc3

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	-(cd obj-*/test; make check0)
endif
