homebrew-core/Formula/field3d.rb

44 lines
1.4 KiB
Ruby

class Field3d < Formula
desc "Library for storing voxel data on disk and in memory"
homepage "https://sites.google.com/site/field3d/"
url "https://github.com/imageworks/Field3D/archive/v1.7.3.tar.gz"
sha256 "b6168bc27abe0f5e9b8d01af7794b3268ae301ac72b753712df93125d51a0fd4"
license "BSD-3-Clause"
bottle do
cellar :any
sha256 "62cd1be576caec00c1d4369e08d226a94f88056588b3b34047e137a012ac6eda" => :catalina
sha256 "3c295ee04d92a9a1e0a87e6af3cf8dc53fcb7679b9518ba18d21c5667a17d458" => :mojave
sha256 "e71612d2b6260538c6a283c1d68e5cfe4fa86325feab85d885e28ea4ddb1aed9" => :high_sierra
end
depends_on "cmake" => :build
depends_on "boost"
depends_on "hdf5"
depends_on "ilmbase"
def install
ENV.cxx11
ENV.prepend "CXXFLAGS", "-DH5_USE_110_API"
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make", "install"
end
man1.install "man/f3dinfo.1"
pkgshare.install "contrib", "test", "apps/sample_code"
end
test do
system ENV.cxx, "-std=c++11", "-I#{include}", "-L#{lib}", "-lField3D",
"-I#{Formula["boost"].opt_include}",
"-L#{Formula["boost"].opt_lib}", "-lboost_system",
"-I#{Formula["hdf5"].opt_include}",
"-L#{Formula["hdf5"].opt_lib}", "-lhdf5",
"-I#{Formula["ilmbase"].opt_include}",
pkgshare/"sample_code/create_and_write/main.cpp",
"-o", "test"
system "./test"
end
end