Working on a C++ project really does make me appreciate Haskell's tooling. Other languages are just so much worse here.
What happens if you provide an invalid library name for cmake in target_link_libraries()? Nothing, really. CMake will just ignore it.
Does cmake --fresh really start a fresh build, ignoring local caches? No, you need to clean up things manually sometimes or you'll run into bizarre errors.
And this stuff is just full of little annoying quirks like this.