Skip to content
New this month 24 fresh C++, C#, F#, JavaScript, TypeScript and Lua courses just landed. Browse new releases Use code WELCOME10 for 10% off your first order · 14-day refund

CMake and Ninja in Practice: Reproducible Native Builds

Write CMake you can maintain, with targets, presets and dependencies that just work.

Rated 5.0 out of 5 from 2 reviews 37 students

AP Created by Ana Petrova

  • Last updated August 2026
  • English
  • 2h 38m of material
  • 20 lessons

What you will learn

8 concrete outcomes

Every bullet below is something you will have built, shipped or be able to explain by the time you finish the last lesson.

  • Write target-based CMake using PUBLIC, PRIVATE and INTERFACE correctly
  • Replace global variables and directory properties with usage requirements
  • Use generator expressions for configuration-specific flags without duplication
  • Define CMake presets so every developer builds the same configurations
  • Consume dependencies with find_package, FetchContent, vcpkg or Conan
  • Export an installable package that downstream projects can find_package
  • Integrate CTest and run sanitizer builds as separate presets
  • Cut build times with Ninja, ccache and unity builds, measured before and after

Course curriculum

5 modules · 20 lessons · 2h 38m of material

5 lessons running 40m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 lessons running 38m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 lessons running 40m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

3 lessons running 22m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

2 lessons running 18m in total. Each lesson ships with the finished source files and a short written recap, so you can follow along in your own editor and skim the module again later.

Lesson-by-lesson titles, code downloads and exercises live inside the course library you get access to straight after checkout.

5 modules · 20 lessons

2h 38m total length

Requirements

Short list, and deliberately so. If you meet these you can start today.

  • You build C or C++ projects and have used CMake at least once
  • CMake 3.25 or newer, Ninja and a C++ compiler installed

About this course

Most CMake in the wild was copied from a tutorial written before targets existed, which is why it works until someone adds a second library. This course teaches modern target-based CMake, where every property has a scope and nothing leaks into a global variable.

You begin by rewriting a directory-variable build into targets with PUBLIC, PRIVATE and INTERFACE usage requirements, so include directories, compile definitions and link libraries propagate exactly as far as they should. Generator expressions follow, then presets, which replace the folder of shell scripts every team accumulates for their debug, release and sanitizer configurations.

Dependencies get a full module: find_package and config files, FetchContent for source dependencies, vcpkg and Conan compared, and how to make a project that consumers can find_package cleanly by exporting proper targets. The remaining modules cover CTest integration, cross-compilation with toolchain files, compile times with Ninja, ccache and unity builds, and a reproducible container build that produces identical binaries on any machine.

Topics covered

Frequently asked questions

Still unsure about something? Write to misteryjj100@gmail.com and a human answers, usually the same working day.

Only as a short comparison. The course is specifically about CMake, which remains the default for portable C and C++ projects and for most library ecosystems.

Yes. Every example is verified with MSVC, GCC and Clang, and the presets include Windows configurations with the Visual Studio and Ninja generators.

That is the opening exercise. You migrate a variable-based build to targets incrementally, keeping it working at every step.

Checkout is handled on our provider's secure payment page. The moment your payment clears we email your personal access link and access code to the address you used at checkout, and the same link appears in your account library. There is nothing to install and nothing to wait for.

Email misteryjj100@gmail.com within 14 days of your purchase, quote your order number, and we refund the full amount to your original payment method. No form to fill in and no questions about how much of the course you watched.

What students say

Reviews are written by people who bought this course. We publish the critical ones too.

5.0

Rated 5.0 out of 5

Course rating · 2 reviews

Rating distribution

  • 5 stars 100%
  • 4 stars 0%
  • 3 stars 0%
  • 2 stars 0%
  • 1 star 0%
  • HB

    Henrik Bauer

    C++ engineer

    Jan 2026
    Rated 5.0 out of 5

    Target-based CMake, at long last

    Nearly every CMake tutorial still sets include directories globally and then acts surprised when a dependency leaks everywhere. Starting from targets and usage requirements, and never once calling include_directories at the top level, is how this should be taught.
  • JN

    Julia Novák

    Build engineer

    Sep 2025
    Rated 5.0 out of 5

    Presets fixed our onboarding

    New starters used to burn half a day on build configuration. We lifted the presets layout straight from this course and it is now a single command. Generator expressions still make my eyes water, but at least I know where to look them up.

Your instructor

AP

Ana Petrova

Systems engineer and C++ instructor

  • 206 students taught
  • 9 courses published
  • 4.4 instructor rating
  • C++
  • Systems programming
  • Memory management
  • Concurrency

Ana spent nine years writing real-time C++ for trading infrastructure before moving into teaching full time. She specialises in the parts of the language people quietly avoid: templates, move semantics, custom allocators and the memory model. Her courses are built around profiling sessions on code that is deliberately slow, so every fix is something you measure rather than memorise. She still contributes to two open-source benchmarking libraries.

$12 USD

One-time payment · lifetime access

The WisdomCharms dispatch

One useful email a week. No fluff, no spam.

New course releases, discount codes before anyone else, and a short, practical breakdown of one technique — a prompt pattern, a C++ idiom, a TypeScript trick — that you can use the same day.

  • Subscriber-only launch pricing
  • Unsubscribe in one click
  • We never sell your address

By subscribing you agree to our Privacy Policy. Questions? Write to misteryjj100@gmail.com.