homebrew-core/Formula/dartsim.rb

56 lines
1.7 KiB
Ruby

class Dartsim < Formula
desc "Dynamic Animation and Robotics Toolkit"
homepage "https://dartsim.github.io/"
url "https://github.com/dartsim/dart/archive/v6.9.2.tar.gz"
sha256 "7d46d23c04d74d3b78331f9fa7deb5ab32fd4b0c03b93548cd84a2d67771d816"
revision 4
bottle do
sha256 "2aa3b737196c020defbfc8699ef0aef3c804fcf084a5af354926263e5154ee6e" => :catalina
sha256 "42bc8032975834aae7f61a26046bbc6b1412b040d0ccdc35222d312fd4aa824a" => :mojave
sha256 "c1254367042d7185bd458f7b5b5c5143d5cbc8e272a30066be4a504a275d00b3" => :high_sierra
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "assimp"
depends_on "boost"
depends_on "bullet"
depends_on "eigen"
depends_on "fcl"
depends_on "flann"
depends_on "ipopt"
depends_on "libccd"
depends_on "nlopt"
depends_on "ode"
depends_on "open-scene-graph"
depends_on "tinyxml2"
depends_on "urdfdom"
def install
ENV.cxx11
# Force to link to system GLUT (see: https://cmake.org/Bug/view.php?id=16045)
system "cmake", ".", "-DGLUT_glut_LIBRARY=/System/Library/Frameworks/GLUT.framework",
*std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <dart/dart.hpp>
int main() {
auto world = std::make_shared<dart::simulation::World>();
assert(world != nullptr);
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-I#{Formula["eigen"].include}/eigen3",
"-I#{include}", "-L#{lib}", "-ldart",
"-L#{Formula["assimp"].opt_lib}", "-lassimp",
"-L#{Formula["boost"].opt_lib}", "-lboost_system",
"-std=c++14", "-o", "test"
system "./test"
end
end