First, you should install CMake on your system, if it is not already present. On RHEL and CentOS, type:
# yum install cmake
On Debian/Ubuntu type:
# apt-get install cmake
Next, install any dependencies required by the program. There should be a list of them in the README or INSTALL file. If not, you might need to check the program’s documentation.
Next, you should navigate to the directory containing the cmake files and create a build directory, and then change to that directory:
$ mkdir build
$ cd build
Then, simply run CMake:
$ cmake ..
You can consult the CMake documentation for available options. For example, to select a build type, you would pass an option like this:
cmake .. -DCMAKE_BUILD_TYPE=Release
Once CMake has generated the buildscripts, you should run Make as you normally would.
And finally, install the program:
# make install
For more information about CMake as well as full developer information, visit the CMake resources website.
- Building Programs from Source on a Linux Server
- Listening for Programs on Server Ports
- How to Build a Chroot Environment in CentOS
- Using A Cluster Server To Build A Supercomputer
- Build an Open Source Private or Hybrid Cloud with Eucalyptus