aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/tinyxml2.rb
blob: fbfc358c837c1cd355e0314b21b188ec9b9ea4c5 (plain)
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
require "formula"

class Tinyxml2 < Formula
  homepage "http://grinninglizard.com/tinyxml2"
  url "https://github.com/leethomason/tinyxml2/archive/2.0.2.tar.gz"
  sha1 "c78a4de58540e2a35f4775fd3e577299ebd15117"
  head "https://github.com/leethomason/tinyxml2.git", :branch => "master"

  depends_on "cmake" => :build

  def install
    system "cmake", ".", *std_cmake_args
    system "make", "install"
  end

  test do
    (testpath/'test.cpp').write <<-EOS.undent
      #include <tinyxml2.h>
      int main() {
        tinyxml2::XMLDocument doc (false);
        return 0;
      }
    EOS
    system ENV.cc, "test.cpp", "-ltinyxml2"
  end
end