cmake Cheat Sheet
Below is a cheat sheet for the most common statements you will use in a
By no means is this a complete reference guide, even for the mentioned functions (commonly they are just depicted in their most used form). For full documentation, see https://cmake.org/documentation/.
Sorted roughly by in which order you would use them (i.e. from compiling to linking).
|Creates a variable (e.g. |
|Adds the provided directory paths to the compilers list of directories that it will search for include files in, for any following targets.|
|Adds a library target that will be build from the provided source files. **DO NOT APPEND** |
|Adds an executable target (as opposed to a library target).|
|Links the provided libraries to all following targets in the CMakeLists.txt file. This is deprecated. It is recommended you use |
|Links the provided libraries to the specific target library. |
|Used to place build output into certain directories on the user's system (as well as do things like assign privileges to these files).|