Created
October 10, 2012 18:33
-
-
Save 2bits/3867536 to your computer and use it in GitHub Desktop.
itk formula
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Insighttoolkit < Formula | |
homepage 'http://www.itk.org' | |
url 'http://sourceforge.net/projects/itk/files/itk/4.2/InsightToolkit-4.2.0.tar.gz' | |
sha1 '5d1fb109cc8b8648772b654f898a531d9af01e38' | |
head 'git://itk.org/ITK.git' | |
depends_on 'cmake' => :build | |
depends_on 'hdf5' | |
depends_on 'jpeg' | |
depends_on 'szip' | |
depends_on 'fftw' | |
depends_on :libpng | |
option 'examples', 'Compile and install various examples' | |
option 'tests', 'Verify the build with make test, approx. 16 min.' | |
option '64int', 'Use 64bit integers for indexing files larger than 4gb' | |
option 'gpu', 'GPU acceleration via OpenCL' | |
option 'python', 'Build the Python bindings' | |
def install | |
args = std_cmake_args + %W[ | |
-DBUILD_SHARED_LIBS=ON | |
-DUSE_SYSTEM_FFTW=ON | |
-DITK_USE_SYSTEM_HDF5=ON | |
-DITK_USE_SYSTEM_JPEG=ON | |
-DITK_USE_SYSTEM_PNG=ON | |
-DITK_USE_SYSTEM_ZLIB=ON | |
-DITK_USE_SYSTEM_TIFF=OFF | |
-DITK_USE_SYSTEM_GDCM=OFF | |
-DITK_USE_SYSTEM_VXL=OFF | |
] | |
args << '-DBUILD_EXAMPLES=' + ((build.include? 'examples') ? 'ON' : 'OFF') | |
args << '-DBUILD_TESTING=' + ((build.include? 'tests') ? 'ON' : 'OFF') | |
args << '-DITK_USE_64BITS_IDS=' + ((build.include? '64int') ? 'ON' : 'OFF') | |
args << '-DITK_USE_GPU=' + ((build.include? 'gpu') ? 'ON' : 'OFF') | |
args << '-DITK_WRAP_PYTHON=' + ((build.include? 'python') ? 'ON' : 'OFF') | |
args << '..' | |
mkdir 'itk-build' do | |
system 'cmake', *args | |
system 'make' | |
system 'make test' if build.include? 'tests' | |
system "make install" | |
end | |
end | |
def test | |
system "itkTestDriver --no-process" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment