Cmake

From UCT EE Wiki
Jump to navigation Jump to search


Overview[edit]

CMake is really about helping with setting up the compile process, to circumvent potentially lengthy, manual processes of preparing makefiles from scratch or manually customizing makefile templates. Visit the CMake Homepage for more detailed information and to download it.

CMake is cross-platform software build process automation tool. It is used for purposes such as generating makefiles without necessarily needing to manually put in directory linking parameters when compiling programs using a particular library. It has many more features than just automating the generation of makefiles, although that is probably the most common use-case for this tool.

The emphasis on "cross-platform" here is providing a solution that is more compiler-independent, and to a large extent computer platform, independent. You can consider C as being in relation to C or C++, incase you were wondering. And if you know a bit about C / C++, then you are familiar with C being a programming language standard that (was) aimed to be largely platform independent, so that the same come could be run on many different types of platforms... at least for code where you are not interfacing directly to platform or peripherals, or have specialized, non-standardized operations (like interfacing to a co-processor).

Recommended Tutorials[edit]

If you are interested in making extensive use of cmake, as in developing more substantial programmes with it as apposed to just small programmes that you want to make easily cross-platform compilable, then look at the official CMake tutorial, this will give you a deep understanding of CMake, and you need about 2 - 4 hours to get through the reading and tutorial:

https://cmake.org/cmake/help/latest/guide/tutorial/index.html


If you more want just a quick-start and brief experiment with using CMake, then have a look at this quick and easy tutorial in the linked below.... this tutorial gives you options to have a super-quick glimpse of using the tool (in Listing 1) and progresses towards more advanced use (in Listing 6); the nice things is that the author has given short and clear explanations of what is being done for each listing.

http://derekmolloy.ie/hello-world-introductions-to-cmake/