Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing cmake with home-brew

Tags:

homebrew

cmake

I'm new to programming. Can you please help me install cmake? I typed brew install cmake. What should I do next?

like image 634
Raag Saluja Avatar asked Aug 24 '15 14:08

Raag Saluja


People also ask

How manually install CMake?

app into /Applications (or a custom location), run it and follow the “How to Install For Command Line Use” menu item for instructions to make the command-line tools (e.g. cmake) available in the PATH. Or, one may manually add the install directory (e.g. /Applications/CMake. app/Contents/bin) to the PATH.

What is PIP install CMake?

pip install cmake. Released: Aug 5, 2022. CMake is an open-source, cross-platform family of tools designed to build, test and package software.


3 Answers

Typing brew install cmake as you did installs cmake. Now you can type cmake and use it.

If typing cmake doesn’t work make sure /usr/local/bin is your PATH. You can see it with echo $PATH. If you don’t see /usr/local/bin in it add the following to your ~/.bashrc:

export PATH="/usr/local/bin:$PATH" 

Then reload your shell session and try again.


(all the above assumes Homebrew is installed in its default location, /usr/local. If not you’ll have to replace /usr/local with $(brew --prefix) in the export line)

like image 98
bfontaine Avatar answered Oct 21 '22 06:10

bfontaine


  1. Download the latest CMake Mac binary distribution here: https://cmake.org/download/ (current latest is: https://cmake.org/files/v3.17/cmake-3.17.1-Darwin-x86_64.dmg)

  2. Double click the downloaded .dmg file to install it. In the window that pops up, drag the CMake icon into the Application folder.

  3. Add this line to your .bashrc file: PATH="/Applications/CMake.app/Contents/bin":"$PATH"

  4. Reload your .bashrc file: source ~/.bashrc

  5. Verify the latest cmake version is installed: cmake --version

  6. You can launch the CMake GUI by clicking on LaunchPad and typing cmake. Click on the CMake icon that appears.

like image 37
sizzle Avatar answered Oct 21 '22 06:10

sizzle


On MacBooks with M1 processor:

Install:

arch -arm64 brew install cmake

Upgrade:

arch -arm64 brew upgrade cmake
like image 32
Ramis Avatar answered Oct 21 '22 07:10

Ramis