Рет қаралды 8,662
In this video we talk about *CMake*, one of the most used build generation tools. It allows us to have a readable but comprehensive script for our build. Chances are if you look for a random open source project it will support CMake out of the box. We don't cover everything there is about CMake, but pretty much cover most of the important things.
🎓 Slides: github.com/cpp-for-yourself/s...
Related materials
- An amazing CMake tutorial from which lots of inspiration was drawn: cliutils.gitlab.io/modern-cmake/
- Official CMake website: cmake.org
Support Ukraine 🇺🇦
Ukraine is fighting a war against unprovoked russian aggression. Please donate to one of the funds to support them: www.defendukraine.org/donate
Please support my free work 😉🙏
- Through Patreon: / code_for_yourself
- Through GitHub Sponsors: github.com/sponsors/niosus
Stock footage of the dominos clip provided by Videvo, downloaded from videvo.net
Contents
00:00 - Intro
00:41 - What is CMake
01:39 - Intuition behind CMake
02:40 - CMake is just a scripting language
03:32 - Minimal CMake project
04:51 - Explaining what CMake actually does
06:15 - Printing messages in CMake
06:54 - Building a CMake project with cmake command
08:57 - Looking at the cache manually
09:44 - Using ccmake to build the project
11:33 - Using FORCE with variables
12:16 - Using INTERNAL keyword with variables
12:42 - Setting local variables
13:12 - Adding a library with CMake
14:52 - Add executables with CMake
15:07 - Setting target properties with CMake
16:40 - Dependencies between targets
17:52 - What target properties can we set
18:35 - When to use which visibility
19:21 - Example CMake project
27:09 - Outro