40

I installed CMake literally two days ago with no problems through the GUI and selecting "Install Command Line Tools". I just got a brand new Macbook and trying to install CMake again but the option has changed to "How to Install Command Line Tools" and just crashes the app when clicked

Is there a reason it has changed? Is there another way to install the command line tools?

RyanOfCourse
  • 832
  • 1
  • 8
  • 15

3 Answers3

92

As of version 3.9.4, the "How to Install Command Line Tools" says:

One may add CMake to the PATH:

PATH="/Applications/CMake.app/Contents/bin":"$PATH"

Or, to install symlinks to '/usr/local/bin', run:

sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install

Or, to install symlinks to another directory, run:

sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install=/path/to/bin

The middle option worked perfectly for what I needed: installing an older version of Swift using swiftenv.

Community
  • 1
  • 1
leanne
  • 7,940
  • 48
  • 77
  • 1
    As of version 3.20 this still works. Search in "Help" tab for 'Command line' and it will pop up. The middle version worked for me too. – DeepBlue Mar 02 '21 at 10:46
0

Looks like CMake 3.3.0 is broken in that respect...

Anyone finding themselves in the same situation should do what I've just done and revert to 3.2.3 and then the "Install Command Line Tools" is back in business

RyanOfCourse
  • 832
  • 1
  • 8
  • 15
0

First variant of the first comment works till the reboot of console. So, I found solution to open path file

sudo nano /etc/paths

and after that wrote the next line:

"/Applications/CMake.app/Contents/bin":"$PATH"

after that i can use cmake from the console

Scanel
  • 1
  • 1