From d9791affbc6df9c309ee45e5452e6960cc710e15 Mon Sep 17 00:00:00 2001 From: Drew Waranis Date: Tue, 25 Nov 2014 08:26:18 -0800 Subject: assimp: boost is a build dependency Closes #34444. Signed-off-by: Mike McQuaid --- Library/Formula/assimp.rb | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Formula/assimp.rb b/Library/Formula/assimp.rb index 95cba00a4..3967da253 100644 --- a/Library/Formula/assimp.rb +++ b/Library/Formula/assimp.rb @@ -18,10 +18,46 @@ class Assimp < Formula option "without-boost", "Compile without thread safe logging or multithreaded computation if boost isn't installed" depends_on "cmake" => :build - depends_on "boost" => :recommended + depends_on "boost" => [:recommended, :build] def install system "cmake", ".", *std_cmake_args system "make", "install" end + + test do + # Library test. + (testpath/'test.cpp').write <<-EOS.undent + #include + int main() { + Assimp::Importer importer; + return 0; + } + EOS + system ENV.cc, "test.cpp", "-lassimp", "-o", "test" + system "./test" + + # Application test. + (testpath/"test.obj").write <<-EOS.undent + # WaveFront .obj file - a single square based pyramid + + # Start a new group: + g MySquareBasedPyramid + + # List of vertices: + v -0.5 0 0.5 # Front left. + v 0.5 0 0.5 # Front right. + v 0.5 0 -0.5 # Back right + v -0.5 0 -0.5 # Back left. + v 0 1 0 # Top point (top of pyramid). + + # List of faces: + f 4 3 2 1 # Square base (note: normals are placed anti-clockwise). + f 1 2 5 # Triangle on front. + f 3 4 5 # Triangle on back. + f 4 1 5 # Triangle on left side. + f 2 3 5 + EOS + system "assimp", "export", testpath/"test.obj", testpath/"test.ply" + end end -- cgit v1.2.3