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

# Build with no optimization; otherwise test gtest_catch_exceptions_test will segfault.
DEB_BUILD_OPTIONS=noopt

%:
	dh $@ --parallel

override_dh_auto_configure:
	dh_auto_configure --buildsystem=cmake -- -Dgmock_build_tests=ON -Dgtest_build_tests=ON

override_dh_install:
	dh_install
	find debian/googletest/usr/src/googletest -iname LICENSE -o -iname .gitignore -o -iname '*.pyc' | xargs rm
	find debian/googletest/usr/src/googletest -iname '*.py' | xargs chmod -x
	rm -rf debian/googletest/usr/src/googletest/*/msvc
	for f in $$(ls debian/googletest/usr/bin/*.py); \
	  do mv $$f $$(echo $$f | sed s/\.py//); \
	done
	chmod a-x debian/googletest/usr/share/gmock/cpp/*

override_dh_clean:
	dh_clean
	rm -f test/*.pyc
