-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathgz-cmake4.rb
50 lines (44 loc) · 1.54 KB
/
gz-cmake4.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
class GzCmake4 < Formula
desc "CMake helper functions for building robotic applications"
homepage "https://gazebosim.org"
url "https://osrf-distributions.s3.amazonaws.com/gz-cmake/releases/gz-cmake-4.1.1.tar.bz2"
sha256 "9c989d1ac844aa6fc8c4597ffd3dcb4345d3420a8994059483047859a1fa63a1"
license "Apache-2.0"
head "https://github.com/gazebosim/gz-cmake.git", branch: "gz-cmake4"
bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 cellar: :any_skip_relocation, sonoma: "0e9713a3f999c2e4fdb15b71e3db57f0e708179a7fd200c724d3ec7742053ab5"
sha256 cellar: :any_skip_relocation, ventura: "1938094d9f81fe9007c8c2652b4d17399525aa0ac3f62a84ea462d97b3fac1d2"
end
depends_on "cmake"
depends_on "pkgconf"
def install
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=OFF"
# Use a build folder
mkdir "build" do
system "cmake", "..", *cmake_args
system "make", "install"
end
end
test do
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
project(gz-test VERSION 0.1.0)
find_package(gz-cmake4 REQUIRED)
gz_configure_project()
gz_configure_build(QUIT_IF_BUILD_ERRORS)
EOS
%w[doc include src test].each do |dir|
mkdir dir do
touch "CMakeLists.txt"
end
end
mkdir "build" do
system "cmake", ".."
end
# check for Xcode frameworks in bottle
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
end
end