CMake, the cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
Once downloaded, run open cmake-3.1.0-Darvin64.dmg on terminal.
A finder view shown. Drag cmake-3.1.0-Darvin64.dmg to Applications shortcut, it will copy the binary to Applications folder.
Open the applications by sudo.
Do sudo /Applications/CMake.app/Contents/MacOS/CMake
Click on menu Tools, Install for Command line use.
You shall see the result, then you are done.