2011-09-26 20:55:51 +00:00
|
|
|
class Assimp < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Portable library for importing many well-known 3D model formats"
|
2014-11-22 14:39:00 +00:00
|
|
|
homepage "http://assimp.sourceforge.net/"
|
2014-06-17 23:17:49 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/assimp/assimp-3.1/assimp-3.1.1_no_test_models.zip"
|
|
|
|
version "3.1.1"
|
2015-10-05 04:38:54 +00:00
|
|
|
sha256 "da9827876f10a8b447270368753392cfd502e70a2e9d1361554e5dfcb1fede9e"
|
2013-06-05 08:28:27 +00:00
|
|
|
|
2014-11-22 14:39:00 +00:00
|
|
|
head "https://github.com/assimp/assimp.git"
|
2014-03-18 03:44:49 +00:00
|
|
|
|
2014-11-22 09:17:04 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-10-05 17:35:09 +00:00
|
|
|
revision 2
|
|
|
|
sha256 "368ba868e7715635a06d8d677d61f48249df892cf34b9ca71401d91e39e5ac19" => :el_capitan
|
|
|
|
sha256 "8b60177099c612ae291c0509900bb73ec6bfeb5024ac3927e3902e31ed7edc25" => :yosemite
|
|
|
|
sha256 "a4d31ecdae6b3b7bf8c8d8db35d2406e53f9fca8896fcae1efc706f94e3049f0" => :mavericks
|
2014-11-22 09:17:04 +00:00
|
|
|
end
|
|
|
|
|
2014-11-21 12:17:09 +00:00
|
|
|
option "without-boost", "Compile without thread safe logging or multithreaded computation if boost isn't installed"
|
2014-11-22 14:39:00 +00:00
|
|
|
|
|
|
|
depends_on "cmake" => :build
|
2014-11-25 16:26:18 +00:00
|
|
|
depends_on "boost" => [:recommended, :build]
|
2014-03-18 03:44:49 +00:00
|
|
|
|
2011-09-26 20:55:51 +00:00
|
|
|
def install
|
2012-05-22 21:37:04 +00:00
|
|
|
system "cmake", ".", *std_cmake_args
|
2014-11-22 14:39:00 +00:00
|
|
|
system "make", "install"
|
2011-09-26 20:55:51 +00:00
|
|
|
end
|
2014-11-25 16:26:18 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
# Library test.
|
2015-08-03 12:55:31 +00:00
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
2014-11-25 16:26:18 +00:00
|
|
|
#include <assimp/Importer.hpp>
|
|
|
|
int main() {
|
|
|
|
Assimp::Importer importer;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2015-01-13 07:21:18 +00:00
|
|
|
system ENV.cc, "test.cpp", "-L#{lib}", "-lassimp", "-o", "test"
|
2014-11-25 16:26:18 +00:00
|
|
|
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
|
2011-09-26 20:55:51 +00:00
|
|
|
end
|