Under Windows, we can use Cygwin to manage software packages. Under Mac OS X, we can use Macports. Download and install the Macports dmg file, open a terminal window, and type commands like:
sudo port install cmake
Macports will download the source package and compile it for you.
Note: To make Macports knows the most recent package list, type the following commands regularly:
sudo port -v selfupdate
Note: After installing Macports, open a new terminal windows (program), which will use the system environment variables newly updated by the installation program. Using a terminal window which had been opened before Macports installation will leads to an error complaining cannot find ‘port’.