2012-04-20 16:56:36 +00:00
|
|
|
class Glm < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C++ mathematics library for graphics software"
|
2014-06-23 01:35:06 +00:00
|
|
|
homepage "http://glm.g-truc.net/"
|
2015-04-24 05:21:54 +00:00
|
|
|
url "https://mirrors.kernel.org/debian/pool/main/g/glm/glm_0.9.6.3.orig.tar.xz"
|
|
|
|
mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/g/glm/glm_0.9.6.3.orig.tar.xz"
|
|
|
|
sha256 "f9ab688bd6af1e0c454d887e1f5506518f2530d195ce057d96be1a769d42dfbb"
|
|
|
|
|
2014-12-09 18:05:22 +00:00
|
|
|
head "https://github.com/g-truc/glm.git"
|
2012-04-20 16:56:36 +00:00
|
|
|
|
2015-04-24 05:21:54 +00:00
|
|
|
option "with-doxygen", "Build documentation"
|
|
|
|
depends_on "doxygen" => [:build, :optional]
|
|
|
|
|
2012-04-20 16:56:36 +00:00
|
|
|
def install
|
2014-06-23 01:35:06 +00:00
|
|
|
include.install "glm"
|
2015-04-24 05:21:54 +00:00
|
|
|
|
|
|
|
if build.with? "doxygen"
|
|
|
|
cd "doc" do
|
|
|
|
system "doxygen", "man.doxy"
|
|
|
|
man.install "html"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
doc.install Dir["doc/*"]
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <glm/vec2.hpp>// glm::vec2
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
std::size_t const VertexCount = 4;
|
|
|
|
std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2);
|
|
|
|
glm::vec2 const PositionDataF32[VertexCount] =
|
|
|
|
{
|
|
|
|
glm::vec2(-1.0f,-1.0f),
|
|
|
|
glm::vec2( 1.0f,-1.0f),
|
|
|
|
glm::vec2( 1.0f, 1.0f),
|
|
|
|
glm::vec2(-1.0f, 1.0f)
|
|
|
|
};
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cxx, "-I#{include}", testpath/"test.cpp", "-o", "test"
|
|
|
|
system "./test"
|
2012-04-20 16:56:36 +00:00
|
|
|
end
|
|
|
|
end
|