Compile definitions with values assigned get used by C# projects
I have the following code that adds compile definitions to C# and C++ projects in my code base. I use common setup logic for all my targets, they do not distinguish between C#, C++, or C targets:
set( target_name ToolCommon )
target_compile_definitions( ${target_name} PUBLIC ZIOSK_MODULE_NAME=${target_name} )
When generating for Visual Studio 2019, I get this warning when compiling C# targets created by CMake:
Warning: The parameter to the compiler is invalid, '/define:ZIOSK_MODULE_NAME=ToolCommon' will be ignored.
The Microsoft documentation for this option states that definitions with values are not accepted. Shouldn't CMake, in this case, know that the target is C# and to automatically drop definitions with values?
I also looked at generator expressions to see if I could somehow say "Only add this definition for C/C++ targets", but I didn't see a way to do that.