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

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

BLDDIR = debian/cmake
TMPDIR = debian/tmp
DIST := $(shell dpkg-parsechangelog | awk '/^Distribution: / {print $$2}')

%:
	dh $@ -Scmake -B$(BLDDIR) --parallel

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=Release \
		-DNO_PTEX=1 \
		-DNO_CLEW=1 \
		-DNO_CUDA=1 \
		-DNO_OPENCL=1 \
		-DNO_MAYA=1 \
		-DNO_DOC=1 \
		-DNO_TUTORIALS=1 \
		-DNO_REGRESSION=1 \
		-DNO_EXAMPLES=1

override_dh_auto_install:
	dh_auto_install
	# CMAKE_SKIP_RPATH cannot be used because it causes build failure.
	chrpath -d $(TMPDIR)/usr/bin/* $(TMPDIR)/usr/lib/lib*.so
