all: installed

VER = 1.6.7
TARBALL       = build/flann-$(VER)-src.zip
TARBALL_URL   = http://pr.willowgarage.com/downloads/flann-$(VER)-src.zip
UNPACK_CMD    = unzip -x
SOURCE_DIR    = build/flann-$(VER)-src
#TARBALL_PATCH = flann_1.6.6.patch
MD5SUM_FILE   = flann-$(VER)-src.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`/../.. BUILD_C_BINDINGS=true BUILD_MATLAB_BINDINGS=false 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 bin doc include lib lib64 share

