Project wide compile options

I would like to set some options (such as /Wall) in the root of my project such that they apply to all code. I tried using add_compile_options but on Windows when I create a project using cmake -G “Visual Studio 17 2022”, these options are added to the ZERO_CHECK target and Visual Studio complains. As an example, adding the /MP option through this method causes problems.

I would rather not have the manual method of ensuring these options are applied repeatedly to each target. And I don’t want to make my own custom macro. I feel like this is a simple enough task that I should be able to accomplish it with out-of-the-box commands. I am using CMake 3.25.1. Can you please guide me towards the correct solution?

add_compile_options should work… Why does VS make noise about things on ZERO_CHECK? That’s an internal target and shouldn’t care about flags at all. I wonder if the generator needs to learn to not do something here. Does generating 2019 work (in case VS got more strict since then)?