Tips and Tricks for Becoming a CMake Master
summary
CMake code creates a custom FindOracle.cmake to locate Oracle client libs and headers, then runs Oracle’s preprocessor via add_custom_command per source to convert embedded SQL to C++ and captures its include search list. The script parses the preprocessor output to extract include directories, exposes them through an INTERFACE_INCLUDE_DIRECTORIES interface library and sets per-source custom command outputs and dependencies so multiple CMake targets can reuse the generated files. Uses generator expressions, marks include paths as SYSTEM to suppress warnings and supports Ninja/Visual Studio builds.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 5:01CMake workflow overview
- 9:10Finding external packages
- 13:04Oracle dependencies
- 18:29Target properties
- 26:30Compiler options and includes
- 35:44Source files and dependencies
- 42:44Generator expressions
- 46:51Custom commands and silent builds
- 51:15Finalizing build and demo
related talks
01h 07mCMake: A Case Study
01h 34mThings I Learnt While Trying to Avoid Becoming a CMake Expert
54mCMake for the Impatient
01h 18mIntegrating C++ Code Generation Into a Large CMake Build
01h 26mOur Other C++ Interfaces
01h 01mGit, CMake, Conan - How to ship and reuse our C++ projects
26mModern CMake for reusable, portable and testable embedded projects
01h 00mC++ #include on a Diet
