To do this setting using your own property sheet, this one must be included by the projects (.vcxproj) before the Microsoft.Cpp.Default.props
.
Otherwise, the properties at the project level will looks good, but not the one used for the CL tasks of the .c(pp).
For example, assuming the following D:\shared\my-customization.props
sheet:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<MY_CUSTOMIZATION_PREAMBLE>1</MY_CUSTOMIZATION_PREAMBLE>
</PropertyGroup>
<PropertyGroup>
<WholeProgramOptimization>false</WholeProgramOptimization>
// some others settings suffers from the same restrictions
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<UseDebugLibraries Condition="'$(Configuration)'!='Release'">true</UseDebugLibraries>
<UseDebugLibraries Condition="'$(Configuration)'=='Release'">false</UseDebugLibraries>
<_PropertySheetDisplayName>MyCustomization preamble</_PropertySheetDisplayName>
</PropertyGroup>
</Project>
To share them on your several projects, it must be included on theirs .vcxproj like this:
[...]
<PropertyGroup Label="Globals">
[...]
</PropertyGroup>
<Import Project="D:\my-customization.props" Condition="'$(MY_CUSTOMIZATION_PREAMBLE)' == ''" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
[...]
</PropertyGroup>
[...]
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
[ usual location to import the property sheet ]