class Mavsdk < Formula desc "API and library for MAVLink compatible systems written in C++11" homepage "https://mavsdk.mavlink.io" url "https://github.com/mavlink/MAVSDK.git", tag: "v0.35.0", revision: "0a556e5bf418937dceef9c45a2ba75f2d36f62fe" license "BSD-3-Clause" livecheck do url :stable regex(/^v?(\d+(?:\.\d+)+)$/i) end bottle do cellar :any sha256 "16e3e80a65b84f409ee3631881277e8a5a471a114b3d678a57cb54dcf1d94e0e" => :big_sur sha256 "d5da90b3f15d68022aa5e2b10f834017691cee5670da5bdd70d9a8d8bbb26423" => :catalina sha256 "6ba8c322043d8c6110b85f7b98bc5f9dcbc48e7e1796ff0640f37c667d700036" => :mojave end depends_on "cmake" => :build def install system "cmake", *std_cmake_args, "-Bbuild/default", "-DBUILD_BACKEND=ON", "-H." system "cmake", "--build", "build/default", "--target", "install" end test do (testpath/"test.cpp").write <<~EOS #include #include int main() { mavsdk::Mavsdk mavsdk; mavsdk.version(); mavsdk::System& system = mavsdk.system(); auto info = std::make_shared(system); return 0; } EOS system ENV.cxx, "-std=c++11", testpath/"test.cpp", "-o", "test", "-I#{include}/mavsdk", "-L#{lib}", "-lmavsdk", "-lmavsdk_info" system "./test" assert_equal "Usage: backend_bin [-h | --help]", shell_output("#{bin}/mavsdk_server --help").split("\n").first end end