Usually, putting a project together involves generating so-called makefiles and a ‘make’ program that makes everything turn into a whole. If the source code files are organized in these ‘makefiles’, they can be compiled easier and this is the final goal that CMake will help you achieve.
Available as a GUI application, this tool offers a rather simple approach to generating build files with minimal configurations. The functions are neatly placed in the main window so the whole process should be quite straightforward.
The first thing you will have to do is browse for the source folder and make sure that the CMakeLists.txt file is stored inside that directory, because otherwise the operation will fail to complete.
Once those issues are settled, you can specify the output location where the binaries will be sent to. The rest of the task requires a bit of tinkering with the configuration, but that shouldn’t be a reason to worry about because much of it is automated.
Thus, as soon as you hit ‘Configure’, CMake will go ahead and read the files contained in the source folder in order to detect the projects’ variables which it will display colored in red. After thoroughly checking them and making sure the values that are assigned to each are accurate, you can press the ‘Generate’ button and have the build files created in the designate location.
To sum things up, it’s safe to assume that CMake is indeed a powerful tool, but one that is mainly addressed to developers and advanced users who have to carry out a highly technical process.
CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
CMake is quite sophisticated: it is possible to support complex environments requiring pre-processor generation, system configuration, code generation, and template instantiation.
CMake was developed by Kitware as part of the NLM Insight Segmentation and Registration Toolkit project. The ASCI VIEWS project also provided support in the context of their parallel computation environment. Other sponsors include the Insight, VTK, and VXL open source software communities.
The goals for CMake include the following:
· Develop an open source, cross-platform tool to manage the build process,
· Allow the use of native compilers and systems,
· Simplify the build process,
· Optionally provide a user-interface to manage the build system,
· Create an extensible framework,
· Grow a self-sustaining community of software users and developers.
- Supports complex, large build environments. CMake has been proven in several large projects.
- Generates native build files (e.g., makefiles on Unix; workspaces/projects on MS Visual C++). Therefore standard tools can be used on any platform/compiler configuration.
- Has powerful commands include the ability to locate include files, libraries, executables; include external CMake files that encapsulate standard functionality; interfaces to testing systems; supports recursive directory traversal with variable inheritance; can run external programs; supports conditional builds; supports regular expression expansion; and so on.
- Supports in-place and out-of-place builds. Multiple compilation trees are possible from a single source tree.
- Can be easily extended to add new features.
- CMake is open source.
- CMake operates with a cache designed to be interfaced with a graphical editor. The cache provides optional interaction to conditionally control the build process.