Oh. Oh my God.
CMake.
You poor, masochistic soul.
You could have picked a normal build system — something with boundaries. Something that loves you.
But no. You chose the one that looks like it’s helping, but instead leads you through a multi-stage, code-generating, dependency-fetishized ritual of pain that ends with:
“Why does it build on Linux but not on Windows?”
“Why is it linking Boost 1.67 when I asked for 1.75?”
“Why is it… quiet? What’s it doing? What’s it doing?!”
CMake doesn’t build your code.
It builds the instructions that build your code. It’s a meta-build system — a high-control, high-latency dom that says:
“I’ll generate the rules.
You just sit there, unzip your source files, and wait.”
📄 The CMakeLists.txt
— Your Safe Word, Written in Chalk
You don’t “write” a CMakeLists.txt
.
You whisper into it.
cmake_minimum_required(VERSION 3.27)
project(BrokenByDesign LANGUAGES CXX)
Simple, right?
Now try adding:
- External libraries
- Platform-specific flags
- A build type that isn’t Debug
- A non-default install path
- …or God forbid, unit tests
Suddenly your file has if-blocks longer than your last relationship, macros that define macros that define pain, and undocumented behavior that turns on you mid-compilation like a jealous ex in latex.
💦 Out-of-Source Builds — CMake’s Exhibitionism Kink
CMake refuses to touch your source tree directly.
No. You have to build outside. In a separate folder. Like a dirty secret.
mkdir build && cd build
cmake ..
make
This is how CMake tells you:
“I’ll compile it. But not in your bed. On the floor. With my own tools. You’re not invited.”
And if you forget? CMake shames you with error messages written like Victorian rejection letters:
“In-source builds are not allowed. Delete CMakeCache.txt and try again. You filth.”
🔧 Variables, Cache, and Configuration Orgasms
You thought setting a variable was simple?
No.
- You set it with
-DOPTION=ON
- CMake stores it in a cache
- Which you must manually delete if you want to change it later
- Unless you use
ccmake
, CMake’s text-based dungeon UI, where you can edit flags like a masochist inncurses
Want to switch from Release to Debug?
Hope you remembered to clean and regenerate.
If not?
CMake will gaslight your compiler options and tell you it’s your fault.
Because in this relationship, CMake remembers everything — even the things you never meant to say.
🧩 find_package()
— Dependency Domination
You want to use a library?
You must beg.
find_package(OpenSSL REQUIRED)
And suddenly, CMake crawls through your system like a jealous lover:
- Sniffing
/usr/lib
- Peeking into
/opt
- Licking random
pkgconfig
folders - Probing every
.cmake
file it can find
And if it doesn’t find what it wants?
No help. No fallback. Just a dry, one-line error:
“Could not find package OpenSSL.”
As if to say:
“If you loved me, you’d have installed it already.”
🏗 Generator Hell — Ninja? Make? MSBuild? Choose Wisely, Pet.
CMake doesn’t build. It delegates. It commands.
You choose a generator:
Unix Makefiles
: the classic dom — firm, simple, moody.Ninja
: fast, aggressive, unapologetic.Visual Studio
: baroque. Controls you through 300 project files and your registry keys.
And each one? Handles flags, paths, targets, and linking foreplay just a little differently.
You thought you were in charge?
No. You’re in a polyamorous toolchain dungeon now.
😈 Targets — Objects of Desire and Denial
Declare a target
. Bind it to a name. Give it dependencies. Then watch it rebel.
add_executable(my_exe main.cpp)
target_link_libraries(my_exe PRIVATE Threads::Threads)
But miss a line?
The build fails. Silently. Or worse — it compiles, links, and then crashes like a dom who gave you just enough rope to hang yourself.
🥵 Final Thoughts: CMake Doesn’t Build Your Code. It Breaks Your Spirit.
You don’t use CMake. You surrender to it.
- It doesn’t explain. It insinuates.
- It doesn’t fail fast. It fails mysteriously.
- And when it finally works? It’s not because you’re smart. It’s because CMake allowed it.
This isn’t a build system. It’s structural submission. It’s language-less longing compiled in 3 stages with no guarantee of climax.
So next time you cmake ..
, remember:
You’re not compiling.
You’re consensually suffering.