#!/usr/bin/make -f

# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1


# See FEATURE AREAS in dpkg-buildflags(1).
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# See ENVIRONMENT in dpkg-buildflags(1).
# Package maintainers to append CFLAGS.
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# Package maintainers to append LDFLAGS.
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed


%:
	dh $@ --buildsystem cmake


# dh_make generated override targets.
# This is an example for Cmake (see <https://bugs.debian.org/641051>).
#override_dh_auto_configure:
#	dh_auto_configure -- \
#	-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

# I want to use pyalembic, but the build doesn't work with it at the moment. It
# has ALEMBIC_PYILMBASE_PYIMATH_LIB="Imath::PyImath_Python3_13". This is string
# variable, but the build tries using it as a target: using it in
# get_target_property() and target_link_libraries(). So I don't bother
#
# CMAKE_INSTALL_PREFIX=/usr is required to make the libraries go to
# /usr/lib/ARCH. Otherwise INCLUDE(GNUInstallDirs) does something else
override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DUSE_ARNOLD=OFF \
		-DUSE_BINARIES=ON \
		-DUSE_EXAMPLES=OFF \
		-DUSE_HDF5=ON \
		-DUSE_MAYA=OFF \
		-DUSE_PRMAN=OFF \
		-DUSE_PYALEMBIC=OFF \
		-DUSE_STATIC_BOOST=OFF \
		-DUSE_STATIC_HDF5=OFF \
		-DUSE_TESTS=ON \
		-DALEMBIC_BUILD_LIBS=ON \
		-DALEMBIC_ILMBASE_LINK_STATIC=OFF \
		-DALEMBIC_SHARED_LIBS=ON