class Cmake < Formula desc "Cross-platform make" homepage "https://www.cmake.org/" url "https://cmake.org/files/v3.6/cmake-3.6.3.tar.gz" sha256 "7d73ee4fae572eb2d7cd3feb48971aea903bb30a20ea5ae8b4da826d8ccad5fe" head "https://cmake.org/cmake.git" bottle do cellar :any_skip_relocation sha256 "81a8b6e3b7f527edb89c298c8aea367e7fb00bf83f30fc4ee814e0d06b75f3dc" => :sierra sha256 "e0e81368fe89f206582833d5f289c6fc56ee0272b1913361e65e3221efadf447" => :el_capitan sha256 "16f91ff94d784b2120e248650a7a99c5974d325900f94ead54392b2fdaabeb8e" => :yosemite end devel do url "https://cmake.org/files/v3.7/cmake-3.7.0-rc3.tar.gz" sha256 "654a5f0400c88fb07cf7e882e6254d17f248663b51a85ff07d79f7ee7b4795bd" 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`. def install 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 ] # https://github.com/Homebrew/legacy-homebrew/issues/45989 if MacOS.version <= :lion args << "--no-system-curl" else args << "--system-curl" end 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 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