homebrew-core/Formula/nanoflann.rb

42 lines
1.2 KiB
Ruby

class Nanoflann < Formula
desc "Header-only library for Nearest Neighbor search wih KD-trees"
homepage "https://github.com/jlblancoc/nanoflann"
url "https://github.com/jlblancoc/nanoflann/archive/v1.4.2.tar.gz"
sha256 "97fce650eb644a359a767af526cab9ba31842e53790a7279887e1ae2fffe7319"
license "BSD-3-Clause"
head "https://github.com/jlblancoc/nanoflann.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, all: "34a23c7a0d427201a8c75a5fc585a116117d76f55d7087d2267f0a572d47a11c"
end
depends_on "cmake" => :build
on_macos do
depends_on "gcc" => [:build, :test] if DevelopmentTools.clang_build_version <= 1200
end
fails_with :clang do
build 1200
cause "https://bugs.llvm.org/show_bug.cgi?id=23029"
end
def install
system "cmake", "-S", ".", "-B", "build", *std_cmake_args, "-DNANOFLANN_BUILD_EXAMPLES=OFF"
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <nanoflann.hpp>
int main() {
nanoflann::KNNResultSet<size_t> resultSet(1);
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11"
system "./test"
end
end