class Cpprestsdk < Formula desc "C++ libraries for cloud-based client-server communication" homepage "https://github.com/Microsoft/cpprestsdk" url "https://github.com/Microsoft/cpprestsdk/archive/v2.9.1.tar.gz" sha256 "7097889965df48ec5799d6ed3b4f95f16ca82ee3512eb31db844d9df600bc899" head "https://github.com/Microsoft/cpprestsdk.git", :branch => "development" bottle do cellar :any sha256 "35da0bc8f94e1faca8c2d0972d354f2fe15141383157cd5c63205a1d74928c74" => :sierra sha256 "fd091b4222e5c2e512d23c2c86b8f6a3b5064b4bd024b2a154a28e53b11dd1b6" => :el_capitan sha256 "cd0b08daf4d0e02334d57d38e62254a95c82f554011a52ab914da953e5a226e9" => :yosemite end depends_on "boost" depends_on "openssl" depends_on "cmake" => :build def install system "cmake", "-DBUILD_SAMPLES=OFF", "-DBUILD_TESTS=OFF", "Release", *std_cmake_args system "make", "install" end test do (testpath/"test.cc").write <<-EOS.undent #include #include int main() { web::http::client::http_client client(U("https://github.com/")); std::cout << client.request(web::http::methods::GET).get().extract_string().get() << std::endl; } EOS flags = ["-stdlib=libc++", "-std=c++11", "-I#{include}", "-I#{Formula["boost"].include}", "-I#{Formula["openssl"].include}", "-L#{lib}", "-L#{Formula["openssl"].lib}", "-L#{Formula["boost"].lib}", "-lssl", "-lcrypto", "-lboost_random", "-lboost_chrono", "-lboost_thread-mt", "-lboost_system-mt", "-lboost_regex", "-lboost_filesystem", "-lcpprest"] + ENV.cflags.to_s.split system ENV.cxx, "-o", "test_cpprest", "test.cc", *flags system "./test_cpprest" end end