#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# one ring to rule them all ...
%:
	dh $@

# need to provide QTDIR to choose between Qt3 and Qt4
override_dh_auto_configure:
	dh_auto_configure -- \
    --with-qt-dir="/usr/share/qt4" \
    --libdir="/usr/lib/odin" \
    --with-pic \
    --enable-only-standalone-plugin \
    --enable-static \
    --enable-shared \
    --enable-niftisupport \
    --enable-vtksupport \
    --enable-dcmtksupport \
    --enable-pngsupport \
    --with-extra-build-ldflags="-lvtkCommon -lvtkGraphics -lvtkFiltering -lQtGui -lQtCore -lofstd -loflog -lpthread -lz" \
    --with-extra-build-cxxflags="-I/usr/include/vtk-5.4 -I/usr/include/vtk-5.6 -I/usr/include/vtk-5.8"

# do not install unittest suite
override_dh_auto_install:
	dh_auto_install
	rm $(CURDIR)/debian/tmp/usr/bin/odintestsuite

# there is also a 'test' target that doesn't do the right thing
override_dh_auto_test:
	$(MAKE) check

# shared libs in odin package a only for private use
override_dh_makeshlibs:
	dh_makeshlibs -n

# let dh_shlibdeps find the other private libs
# but it does not seem to work though...
override_dh_shlibdeps:
	dh_shlibdeps -l $(CURDIR)/debian/odin/usr/lib/odin

override_dh_clean:
	dh_clean
	find $(CURDIR) -name '*.loT' -delete
