This is probably off topic, since it involves a feature that may or may not be implemented in MSBuild, and if it does eventually get implemented it will take years to come to be effectively used in CMake. The idea is to have something similar to CMake if(DEFINED <variable>)
in MSBuild: the team is currently surveying its userbase about this feature so, if you ever missed the ability to check for the definition of a property in MSBuild, please show your interest here[1].
[1] [Feature Request]: Add a Defined('propname') condition · Issue #9106 · dotnet/msbuild · GitHub