forked from osrf/homebrew-simulation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathignition-math2.rb
44 lines (39 loc) · 1.36 KB
/
ignition-math2.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class IgnitionMath2 < Formula
desc "Math API for robotic applications"
homepage "http://ignitionrobotics.org"
url "http://gazebosim.org/distributions/ign-math/releases/ignition-math2-2.6.0.tar.bz2"
sha256 "5224991ea409346be95c68451934db93d74e2fac9c0b39d961049cfb015696b4"
revision 1
head "https://bitbucket.org/ignitionrobotics/ign-math", :branch => "default", :using => :hg
bottle do
root_url "http://gazebosim.org/distributions/ign-math/releases"
cellar :any
sha256 "098ed08a8d2afb93cfb9e457dc4f82c70ec304f70b8dc375e174116c2c2bce58" => :el_capitan
sha256 "d18ff2dad5ecf0abb515ef8246ad21d9b21def2dc06ffb7a8f81112ea9f22fc2" => :yosemite
end
depends_on "cmake" => :build
depends_on "doxygen" => :build
def install
system "cmake", ".", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include "ignition/math/SignalStats.hh"
int main() {
ignition::math::SignalMean mean;
mean.InsertData(1.0);
mean.InsertData(-1.0);
return static_cast<int>(mean.Value());
}
EOS
system ENV.cc, "test.cpp",
"--std=c++11",
"-I#{include}/ignition/math2",
"-L#{lib}",
"-lignition-math2",
"-lc++",
"-o", "test"
system "./test"
end
end