-
Notifications
You must be signed in to change notification settings - Fork 75
/
ignition-sensors5.rb
73 lines (64 loc) · 2.26 KB
/
ignition-sensors5.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class IgnitionSensors5 < Formula
desc "Sensors library for robotics applications"
homepage "https://github.com/ignitionrobotics/ign-sensors"
url "https://github.com/ignitionrobotics/ign-sensors/archive/c02cd052f263373d630eb8e1a2714d9965cb48d2.tar.gz"
version "4.999.999~0~20201028~c02cd0"
sha256 "fdd953c50aa814f52ec4c769c74c83755ec5056c9b53cd4a899bbd12004e5481"
license "Apache-2.0"
revision 1
head "https://github.com/ignitionrobotics/ign-sensors", branch: "main"
bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 "c2f72851d667d8ba4d114dddcd6deb1cdcffbb0112815ee7be35a71129186757" => :mojave
end
depends_on "cmake" => [:build, :test]
depends_on "pkg-config" => [:build, :test]
depends_on "ignition-cmake2"
depends_on "ignition-common3"
depends_on "ignition-math6"
depends_on "ignition-msgs6"
depends_on "ignition-rendering5"
depends_on "ignition-transport9"
depends_on "sdformat10"
def install
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=OFF"
system "cmake", ".", *cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS
#include <ignition/sensors/Noise.hh>
int main()
{
ignition::sensors::Noise noise(ignition::sensors::NoiseType::NONE);
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
find_package(ignition-sensors5 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-sensors5::ignition-sensors5)
EOS
# test building with pkg-config
system "pkg-config", "ignition-sensors5"
cflags = `pkg-config --cflags ignition-sensors5`.split(" ")
ldflags = `pkg-config --libs ignition-sensors5`.split(" ")
system ENV.cc, "test.cpp",
*cflags,
*ldflags,
"-lc++",
"-o", "test"
system "./test"
# test building with cmake
mkdir "build" do
system "cmake", ".."
system "make"
system "./test_cmake"
end
# check for Xcode frameworks in bottle
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
end
end