#!/usr/bin/make -f

%:
	dh $@ --with=python2 --buildsystem=cmake \
		--builddirectory=utopia-build --parallel

build/dependencies/CMakeCache.txt:
	mkdir -p utopia-build/dependencies && cd utopia-build/dependencies && \
		cmake -C"../../dependencies/CMakeConfig/configurations/Linux.txt" \
		-C"../../dependencies/CMakeConfig/configurations/common.txt" \
		../../dependencies

.PHONY: override_dh_auto_configure
override_dh_auto_configure:	build/dependencies/CMakeCache.txt
	cd utopia-build && \
		cmake -D"CMAKE_VERBOSE_MAKEFILE:BOOL=ON" \
		-C"../CMakeConfig/configurations/Linux.txt" \
		-C"../CMakeConfig/configurations/common.txt" \
		-D"CMAKE_BUILD_TYPE:STRING=Release" \
		-D"UTOPIA_DEPENDENCIES_DIR:STRING=./utopia-build/dependencies" \
		..

.PHONY: override_dh_strip
override_dh_strip:
	dh_strip --dbg-package=utopia-documents-dbg

.PHONY: override_dh_auto_install
override_dh_auto_install:
	dh_auto_install --destdir=debian/utopia-documents

.PHONY: override_dh_installdocs
override_dh_installdocs:
	dh_installdocs --link-doc=utopia-documents

# No public shared libs
.PHONY: override_dh_makeshlibs
override_dh_makeshlibs:
	dh_makeshlibs -Xlib/utopia-documents

.PHONY: override_dh_python2
override_dh_python2:
	dh_python2 -p utopia-documents
