#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

# Define install target dir
INSTALLDIR = $(CURDIR)/debian/tmp
BUILD_FLAGS = -DCMAKE_INSTALL_PREFIX=/usr \
		-DGTK2=OFF \
		-DQT5=ON

BUILDDIR = $(CURDIR)/build

# Create fake-home to work around a bug in lazbuild,
# which now unnecessarily requires a working HOME-dir
fakehome=$(CURDIR)/debian/fakehome
HOME=${fakehome}

%:
	dh $@ --builddirectory=$(BUILDDIR)

override_dh_auto_configure:
	mkdir -p $(BUILDDIR)
	mkdir -p ${fakehome}
	cd $(BUILDDIR) && cmake $(BUILD_FLAGS) ..

override_dh_auto_clean:
	rm -rf ${fakehome}
	dh_auto_clean

override_dh_install:
	dh_install --list-missing

# No dbgsym packages:
override_dh_strip:
	dh_strip --no-automatic-dbgsym
