Skip to content

Commit

Permalink
Merge pull request #203808 from Homebrew/cmake-syntax-update
Browse files Browse the repository at this point in the history
formulae: update to use modern cmake syntax
  • Loading branch information
BrewTestBot authored Jan 10, 2025
2 parents 50fc1df + 6bd7634 commit f35f02f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
14 changes: 9 additions & 5 deletions Formula/g/gflags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ class Gflags < Formula
depends_on "cmake" => [:build, :test]

def install
mkdir "buildroot" do
system "cmake", "..", *std_cmake_args, "-DBUILD_SHARED_LIBS=ON", "-DBUILD_STATIC_LIBS=ON",
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
system "make", "install"
end
args = %w[
-DBUILD_SHARED_LIBS=ON
-DBUILD_STATIC_LIBS=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
]

system "cmake", "-S", ".", "-B", "_build", *args, *std_cmake_args
system "cmake", "--build", "_build"
system "cmake", "--install", "_build"
end

test do
Expand Down
8 changes: 3 additions & 5 deletions Formula/i/ibex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ class Ibex < Formula
def install
ENV.cxx11

mkdir "build" do
system "cmake", "..", *std_cmake_args.reject { |s| s["CMAKE_INSTALL_LIBDIR"] }
system "make", "SHARED=true"
system "make", "install"
end
system "cmake", "-S", ".", "-B", "build", *std_cmake_args.reject { |s| s["CMAKE_INSTALL_LIBDIR"] }
system "cmake", "--build", "build", "--", "SHARED=true"
system "cmake", "--install", "build"

pkgshare.install %w[examples benchs/solver]
(pkgshare/"examples/symb01.txt").write <<~EOS
Expand Down
6 changes: 2 additions & 4 deletions Formula/l/lastpass-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ class LastpassCli < Formula
def install
ENV["XML_CATALOG_FILES"] = etc/"xml/catalog"

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

bash_completion.install "contrib/lpass_bash_completion"
zsh_completion.install "contrib/lpass_zsh_completion" => "_lpass"
Expand Down
10 changes: 4 additions & 6 deletions Formula/m/mbelib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,10 @@ class Mbelib < Formula
depends_on "cmake" => :build

def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make"
system "make", "test"
system "make", "install"
end
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--build", "build", "--target", "test"
system "cmake", "--install", "build"
end

test do
Expand Down
11 changes: 7 additions & 4 deletions Formula/r/rofs-filtered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ class RofsFiltered < Formula
depends_on :linux # on macOS, requires closed-source macFUSE

def install
mkdir "build" do
system "cmake", "..", "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}", *std_cmake_args
system "make", "install"
end
system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
assert_match version.to_s, shell_output("#{bin}/rofs-filtered --version 2>&1")
end
end

0 comments on commit f35f02f

Please sign in to comment.