class Cmake < Formula desc "Cross-platform make" homepage "https://www.cmake.org/" url "https://cmake.org/files/v3.4/cmake-3.4.0.tar.gz" sha256 "a5b82bf6ace6c481cdb911fd5d372a302740cbefd387e05297cb37f7468d1cea" head "https://cmake.org/cmake.git" bottle do cellar :any_skip_relocation sha256 "b3f0a8b41a5797fa43b3f66e6a85582e5ebe65634c15219dc899f4cd79f07f37" => :el_capitan sha256 "c912cc546f2d98c62e1e096a0c3726c26db65311b91fd5acf1a17c834169c475" => :yosemite sha256 "71fd5e66dada2761e09c3933d21bec9b11329cf2859f9a5b5b5713618fa27bbf" => :mavericks 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 install caskroom/cask/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/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 OS X & 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 (share/"emacs/site-lisp/cmake").install "Auxiliary/cmake-mode.el" end test do (testpath/"CMakeLists.txt").write("find_package(Ruby)") system "#{bin}/cmake", "." end end