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