cmakehomebrew

how to install cmake version 3.12 using Homebrew


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.


Solution

  • 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.