CMake: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 8: | Line 8: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
$ wget http://www.cmake.org/files/v2.8/cmake- | $ wget http://www.cmake.org/files/v2.8/cmake-X.Y.Z.tar.gz | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 14: | Line 14: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
$ tar xvzf cmake- | $ tar xvzf cmake-X.Y.Z.tar.gz | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 06:12, 4 April 2011
Cmake is a build system for C++ projects. It is an alternative to autotools.
Installing
Downloading
You can either visit http://www.cmake.org and download the binary, or you can use wget:
$ wget http://www.cmake.org/files/v2.8/cmake-X.Y.Z.tar.gzand untar it using tar:
$ tar xvzf cmake-X.Y.Z.tar.gzConfiguring
Cmake is straightforward to install. It is intended to replace autotools, but it still uses autotools to build it - but a little differently.
You can configure it by running:
$ ./bootstrap --prefix=/path/to/cmake/buildThen you can type make and make install, and you're good to go. Don't forget to add /path/to/cmake/build/bin to your $PATH!
Using
An explanation of how the find_package() function works is here: http://www.itk.org/Wiki/CMake:How_To_Find_Libraries
Presentations
Professor James Sutherland's presentation on using CMake, part of the 2010 Scientific Computing Summer Workshop, is here: File:CMake Sutherland.pdf
This presentation contains an example of a "Hello World" program built with CMake.