#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ -Scmake

override_dh_auto_configure:
	mkdir build
ifeq ($(DEB_HOST_ARCH_CPU),$(filter $(DEB_HOST_ARCH_CPU),amd64))
	cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DSFIZZ_VST=ON ..
else
	cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr/lib -DSFIZZ_VST=ON -DVST3_PACKAGE_ARCHITECTURE=i386 ..
endif

override_dh_auto_build:
	make -C build

override_dh_auto_test:
	#nothing here, only bypassing the test

override_dh_auto_install:
	make -C build -j4 install DESTDIR=$(CURDIR)/debian/sfizz AM_UPDATE_INFO_DIR=no "INSTALL=install --strip-program=true"
