1

I need to install cmake for school. I have tried using the source code but don't really understand where I should unpack it and how to add it to my path. I also tried the .dmg file but the command cmake is not recognized after I dragged it to the applications folder. I have mac osx version 10.14. I am a novice at this, any help is greatly appreciated.

3

For cmake the easiest way is to install the GUI from the .dmg - which you already have done.

For other users. To install the GUI mount the .dmg and then copy Cmake.app to /Applications (a link to that is in the disk)

You can run the build from the GUI which asks for the source and target paths and the type of build system to be generated.

Or you can install the command line tools. Choose from the menu in the GUI Tools->How to install for command line use. This provides instructions on what to do. These are basically telling you where the cmake executable is so that you can add that directory to your PATH

I do use the GUI as it allows easier control of where things are and which build system to generate.

2

An easy way to install cmake is to use a tool like https://brew.sh

Once you have homebrew set up, getting the cmake tool installed on Mojave (and all other recent versions of macos) is as simple as one command:

 brew install cmake

Even for expert command line software installs, this tool is super useful. For novices, the help to set up your path and automate installs and patches is even more powerful and beneficial.

brew link cmake 

Then periodically, you can update it:

brew upgrade
  • Thank you so much bmike... I just followed your advice and instructions and now I have cmake installed! I spent all day messing around with cmake... THANK YOU – CuriousGeorge119 Nov 30 '18 at 5:17
  • A little addition for users of Mojave and later: I had to call "brew link cmake" before brew's install of cmake was in my path. – Nils Hott Aug 22 at 9:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .