#!/usr/bin/make -f

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

# DEB_BUILD_OPTIONS
#ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
#        CXXFLAGS += -O0
#else
#        CXXFLAGS += -O2
#endif
# DEB_BUILD_OPTIONS


# Use this variable to define the particular version of OGRE that we're building
OGRE_VERSION=1.7.3

OGRE_CHANGELOG = Docs/ChangeLog.html


%:
	dh $@ --buildsystem=cmake --with quilt

override_dh_auto_configure:
	dh_auto_configure -- \
		-DOGRE_BUILD_SAMPLES:BOOL=FALSE \
		-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF

override_dh_auto_build:
	dh_auto_build --parallel

override_dh_auto_install:
        # Copy files from template for this particular version
	cp -f debian/libogre-VERSION.install debian/libogre-$(OGRE_VERSION).install
	cp -f debian/libogre-VERSION.manpages debian/libogre-$(OGRE_VERSION).manpages
	cp -f debian/libogre-VERSION.lintian-overrides debian/libogre-$(OGRE_VERSION).lintian-overrides

	dh_auto_install

override_dh_installchangelogs:
	dh_installchangelogs $(OGRE_CHANGELOG)

override_dh_strip:
	dh_strip -plibogre-$(OGRE_VERSION) --dbg-package=libogre-$(OGRE_VERSION)-dbg --exclude=ogre-tools
	dh_strip -pogre-tools

override_dh_clean:
	dh_clean

        # Remove files from template
	rm -rf debian/libogre-$(OGRE_VERSION).*
