-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvpp.rb
57 lines (48 loc) · 1.64 KB
/
vpp.rb
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Vpp < Formula
homepage "https://github.com/matt-42/vpp"
#url "https://github.com/matt-42/vpp/archive/0.2.tar.gz"
url "https://github.com/matt-42/vpp/archive/e03f0dd4d33953c0017b946995960e491a928426.zip"
head "https://github.com/matt-42/vpp.git",
:using => :git
version "0.3.1"
option "with-benchmarks", "Build and run benchmarks"
option "with-examples", "Build and install examples"
depends_on "cmake" => :build
depends_on "llvm" => :build
depends_on "eigen" => :build
depends_on "homebrew/science/opencv" => :build
depends_on "fish2000/praxa/iod"
depends_on "fish2000/praxa/dige"
def install
# Use brewed Clang
# ENV['CC'] = Formula['llvm'].opt_prefix/"bin/clang"
# ENV['CXX'] = Formula['llvm'].opt_prefix/"bin/clang++"
ENV.append_to_cflags "-I#{Formula['eigen'].opt_prefix/"include"}"
ENV.append_to_cflags "-I#{Formula['eigen'].opt_prefix/"include/eigen3"}"
ENV.append_to_cflags "-I#{Formula['opencv'].opt_prefix/"include"}"
cargs = std_cmake_args
cargs.keep_if { |v| v !~ /DCMAKE_VERBOSE_MAKEFILE/ }
mkdir "build" do
system "cmake", "..", *cargs
system "make"
system "make", "install"
end
if build.with? "benchmarks"
cd "benchmarks" do
mkdir "build" do
system "cmake", "..", *cargs
system "make"
end
end
end
if build.with? "examples"
cd "examples" do
mkdir "build" do
system "cmake", "..", *cargs
system "make"
system "make", "install"
end
end
end
end
end