Moving from CMake 3.21.2 to 4.0.1 and now CXX_STANDARD only seems to partially work?

Hello Y’all,

I’m moving my MSVC based project from my old PC to a new one. In the process I’m upgrading some build software alongside it, such as CMake which on my old machine is 3.21.2 and on the new one 4.0.1.

I used to set the C++ standard on 3 different projects in my solution, but now, only the very last target appears to actually take/listen to CMake’s CXX_STANDARD. I’ve had to update boost and change some other parts, but nothing I’d imagine should affect the standard being set.

No matter what I’ve tried, the C++ standard remains C++17 on the first 2 targets, but the last one to be set will happily switch to C++20 or even C++23.

Anyone else run into this issue?

Cheers,
gazoo

See if you can produce a minimal reproducer and post a link to godbolt or a github gist or somethign.