2011-08-28 06:29:04 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Flann < Formula
|
|
|
|
homepage 'http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN'
|
2012-02-21 06:04:21 +00:00
|
|
|
url 'http://people.cs.ubc.ca/~mariusm/uploads/FLANN/flann-1.7.1-src.zip'
|
2012-01-13 21:56:07 +00:00
|
|
|
md5 'd780795f523eabda7c7ea09c6f5cf235'
|
2011-08-28 06:29:04 +00:00
|
|
|
|
2012-08-28 04:45:37 +00:00
|
|
|
option 'enable-python', 'Enable python bindings'
|
|
|
|
option 'enable-matlab', 'Enable matlab/octave bindings'
|
|
|
|
option 'with-examples', 'Build and install example binaries'
|
2011-08-28 06:29:04 +00:00
|
|
|
|
|
|
|
depends_on 'cmake' => :build
|
|
|
|
depends_on 'hdf5'
|
|
|
|
|
2012-08-28 04:45:37 +00:00
|
|
|
depends_on 'octave' if build.include? 'enable-matlab'
|
|
|
|
depends_on 'numpy' => :python if build.include? 'enable-python'
|
2011-08-28 06:29:04 +00:00
|
|
|
|
|
|
|
def install
|
2012-05-22 21:37:04 +00:00
|
|
|
args = std_cmake_args
|
2012-08-28 04:45:37 +00:00
|
|
|
if build.include? 'enable-matlab'
|
2011-08-28 06:29:04 +00:00
|
|
|
args << '-DBUILD_MATLAB_BINDINGS:BOOL=ON'
|
|
|
|
else
|
|
|
|
args << '-DBUILD_MATLAB_BINDINGS:BOOL=OFF'
|
|
|
|
end
|
|
|
|
|
2012-08-28 04:45:37 +00:00
|
|
|
if build.include? 'enable-python'
|
2011-08-28 06:29:04 +00:00
|
|
|
args << '-DBUILD_PYTHON_BINDINGS:BOOL=ON'
|
|
|
|
else
|
|
|
|
args << '-DBUILD_PYTHON_BINDINGS:BOOL=OFF'
|
|
|
|
end
|
|
|
|
|
2012-08-28 04:45:37 +00:00
|
|
|
inreplace 'CMakeLists.txt', 'add_subdirectory( examples )', '' unless build.include? 'with-examples'
|
2011-08-28 06:29:04 +00:00
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
mkdir 'build'
|
|
|
|
cd 'build' do
|
2011-08-28 06:29:04 +00:00
|
|
|
system 'cmake', '..', *args
|
|
|
|
system 'make install'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|