Managing dependencies with CMake
summary
Explains concrete recipes: use modern target-based find_package with CMake’s ~1880 shipped modules, prefer target imports over raw include/library variables, and avoid ad hoc shared-drive libraries; use fetch content for small projects (sources built locally, slower), use Conan for medium projects (conan generates conan_toolchain.cmake and supplies prebuilt binaries for faster CI), and adopt CMake dependency providers for large ecosystems; tradeoffs: build time, package ecosystem coverage, and complexity of CI integration.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:53About the speaker
- 2:36CMake basics overview
- 5:35Dependency management problem
- 7:47Using find_package
- 10:00Boost example
- 12:55Target-based linking
- 15:02FetchContent for dependencies
- 17:11Package managers in C++
- 18:17Conan integration
- 20:27Dependency providers
- 22:32FetchContent vs Conan
- 24:43Choosing the right tool
- 25:30Q&A session
