#!/usr/bin/make -f
export DEB_BUILD_OPTIONS += noautodbgsym
export DEB_CFLAGS_MAINT_APPEND += -fPIC

%:
	dh $@ -Dtoonz/sources -Bbuild -Scmake+ninja

override_dh_auto_configure:
	cd thirdparty/tiff-4.0.3 && \
		./configure --with-pic --disable-jbig 
	$(MAKE) -C thirdparty/tiff-4.0.3 -j$(shell nproc --ignore=1)
	dh_auto_configure  -- \
		-DCMAKE_SKIP_RPATH=ON \
		-DWITH_SYSTEM_LZO=ON \
		-DWITH_SYSTEM_SUPERLU=ON \
		-DWITH_TRANSLATION=OFF

override_dh_auto_clean:
	[ ! -f thirdparty/tiff-4.0.3/Makefile ] || \
		$(MAKE) -C thirdparty/tiff-4.0.3 distclean
	dh_auto_clean

override_dh_auto_test:
