5

I need to use the old version for cmake but I can't find the formula in homebrew, is that a way to install cmake 3.12 using Homebrew?

EDITED: the solution presented here is much more objective considering the answers from the previous question.

1

1 Answer 1

5

Brief

# install cmake  3.12.4
curl -O https://github.com/Homebrew/homebrew-core/raw/a3b64391ebace30b84de8e7997665a1621c0b2c0/Formula/cmake.rb
brew install ./cmake.rb

Detail

You could install it from specific formula file.

  1. Go to homebrew/homebrew-core, the place where package formula is stored.
  2. Use the search bar to search "cmake" in this repository.
  3. Find the specific commit you want.
  4. Enter it. And find the RAW url for this cmake.rb file.
  5. Download the formula file and brew install path-to-cmake.rb.

Update 1: Homebrew 3.6.0 removed the function to install with URL of a formula. We need to download the formula file first.

Sign up to request clarification or add additional context in comments.

6 Comments

Just found the problem is duplicate of stackoverflow.com/questions/3987683/…
This does not work anymore
Error: Installation of cmake from a GitHub commit URL is unsupported! brew extract cmake to a stable tap on GitHub instead.
Sorry, forgot to update the answer. Homebrew dropped the support for installation from url. @Yingchen
If you download the older formula file (e.g. with wget), you can install it from source: brew install -s ./url-to-cmake.rb
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.