Skip to content

Commit f35f02f

Browse files
authored
Merge pull request #203808 from Homebrew/cmake-syntax-update
formulae: update to use modern cmake syntax
2 parents 50fc1df + 6bd7634 commit f35f02f

File tree

5 files changed

+25
-24
lines changed

5 files changed

+25
-24
lines changed

Formula/g/gflags.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ class Gflags < Formula
2222
depends_on "cmake" => [:build, :test]
2323

2424
def install
25-
mkdir "buildroot" do
26-
system "cmake", "..", *std_cmake_args, "-DBUILD_SHARED_LIBS=ON", "-DBUILD_STATIC_LIBS=ON",
27-
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
28-
system "make", "install"
29-
end
25+
args = %w[
26+
-DBUILD_SHARED_LIBS=ON
27+
-DBUILD_STATIC_LIBS=ON
28+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
29+
]
30+
31+
system "cmake", "-S", ".", "-B", "_build", *args, *std_cmake_args
32+
system "cmake", "--build", "_build"
33+
system "cmake", "--install", "_build"
3034
end
3135

3236
test do

Formula/i/ibex.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@ class Ibex < Formula
3131
def install
3232
ENV.cxx11
3333

34-
mkdir "build" do
35-
system "cmake", "..", *std_cmake_args.reject { |s| s["CMAKE_INSTALL_LIBDIR"] }
36-
system "make", "SHARED=true"
37-
system "make", "install"
38-
end
34+
system "cmake", "-S", ".", "-B", "build", *std_cmake_args.reject { |s| s["CMAKE_INSTALL_LIBDIR"] }
35+
system "cmake", "--build", "build", "--", "SHARED=true"
36+
system "cmake", "--install", "build"
3937

4038
pkgshare.install %w[examples benchs/solver]
4139
(pkgshare/"examples/symb01.txt").write <<~EOS

Formula/l/lastpass-cli.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ class LastpassCli < Formula
3434
def install
3535
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"
3636

37-
mkdir "build" do
38-
system "cmake", "..", *std_cmake_args, "-DCMAKE_INSTALL_MANDIR:PATH=#{man}"
39-
system "make", "install", "install-doc"
40-
end
37+
system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_MANDIR=#{man}", *std_cmake_args
38+
system "cmake", "--build", "build", "--target", "install", "--target", "install-doc"
4139

4240
bash_completion.install "contrib/lpass_bash_completion"
4341
zsh_completion.install "contrib/lpass_zsh_completion" => "_lpass"

Formula/m/mbelib.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ class Mbelib < Formula
2727
depends_on "cmake" => :build
2828

2929
def install
30-
mkdir "build" do
31-
system "cmake", "..", *std_cmake_args
32-
system "make"
33-
system "make", "test"
34-
system "make", "install"
35-
end
30+
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
31+
system "cmake", "--build", "build"
32+
system "cmake", "--build", "build", "--target", "test"
33+
system "cmake", "--install", "build"
3634
end
3735

3836
test do

Formula/r/rofs-filtered.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ class RofsFiltered < Formula
1515
depends_on :linux # on macOS, requires closed-source macFUSE
1616

1717
def install
18-
mkdir "build" do
19-
system "cmake", "..", "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}", *std_cmake_args
20-
system "make", "install"
21-
end
18+
system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}", *std_cmake_args
19+
system "cmake", "--build", "build"
20+
system "cmake", "--install", "build"
21+
end
22+
23+
test do
24+
assert_match version.to_s, shell_output("#{bin}/rofs-filtered --version 2>&1")
2225
end
2326
end

0 commit comments

Comments
 (0)