all: installed

VER = 1.5
TARBALL       = build/flann-$(VER).zip
TARBALL_URL   = http://pr.willowgarage.com/downloads/flann-$(VER).zip
UNPACK_CMD    = unzip -x
SOURCE_DIR    = build/flann-$(VER)
#TARBALL_PATCH = cmakelists.patch dist_extended.patch hdf5.patch
MD5SUM_FILE   = flann-$(VER).zip.md5sum

include $(shell rospack find mk)/download_unpack_build.mk

installed: wiped $(SOURCE_DIR)/unpacked
	echo "Building FLANN..."
	cd $(SOURCE_DIR) && INSTALL_PREFIX=`pwd`/../.. make install
	#	if [ `uname` = Darwin ]; then \
#		install_name_tool -id `rospack find FLANN`/build/flann-$(VER)_pre2/build/lib/libflann.dylib build/flann-$(VER)_pre2/build/lib/libflann.dylib; \
#	fi
	touch installed

clean: wipe

wiped: Makefile
	make wipe
	touch wiped

wipe:
	rm -rf build installed lib include bin python

