homebrew-core/Formula/cmake.rb
ilovezfs db6f7662e5
cmake: needs C++11 (#23110)
set ENV.cxx11 on OS X < Mavericks
2018-01-20 08:14:31 -08:00

65 lines
2 KiB
Ruby

class Cmake < Formula
desc "Cross-platform make"
homepage "https://www.cmake.org/"
url "https://cmake.org/files/v3.10/cmake-3.10.2.tar.gz"
sha256 "80d0faad4ab56de07aa21a7fc692c88c4ce6156d42b0579c6962004a70a3218b"
head "https://cmake.org/cmake.git"
bottle do
cellar :any_skip_relocation
sha256 "7ad98f403e21c76cfd0789d83acffce92cb29aad3d2ea9b4fe8b2c05de8f33b9" => :high_sierra
sha256 "878aeaeda98df7a8940bdccc42b7ff22195980a62410428f8febc7cd03a1c681" => :sierra
sha256 "05efc0e612c16eabdf8e509545d18a7e1016de2c6cb6deb597b49ffd590dcc0a" => :el_capitan
end
option "without-docs", "Don't build man pages"
option "with-completion", "Install Bash completion (Has potential problems with system bash)"
depends_on "sphinx-doc" => :build if build.with? "docs"
# The `with-qt` GUI option was removed due to circular dependencies if
# CMake is built with Qt support and Qt is built with MySQL support as MySQL uses CMake.
# For the GUI application please instead use `brew cask install cmake`.
needs :cxx11
def install
ENV.cxx11 if MacOS.version < :mavericks
args = %W[
--prefix=#{prefix}
--no-system-libs
--parallel=#{ENV.make_jobs}
--datadir=/share/cmake
--docdir=/share/doc/cmake
--mandir=/share/man
--system-zlib
--system-bzip2
--system-curl
]
if build.with? "docs"
# There is an existing issue around macOS & Python locale setting
# See https://bugs.python.org/issue18378#msg215215 for explanation
ENV["LC_ALL"] = "en_US.UTF-8"
args << "--sphinx-man" << "--sphinx-build=#{Formula["sphinx-doc"].opt_bin}/sphinx-build"
end
system "./bootstrap", *args, "--", "-DCMAKE_BUILD_TYPE=Release"
system "make"
system "make", "install"
if build.with? "completion"
cd "Auxiliary/bash-completion/" do
bash_completion.install "ctest", "cmake", "cpack"
end
end
elisp.install "Auxiliary/cmake-mode.el"
end
test do
(testpath/"CMakeLists.txt").write("find_package(Ruby)")
system bin/"cmake", "."
end
end