I support a fairly large number of projects with 20+ configurations, and some configurations are added from time to time. Spreading such changes across all projects is what we are doing right now with VCBuild. I started experimenting with MSBuild, and there seems to be some kind of logic to extract them into a separate property sheet, allowing you to make changes in one place. How can I do it?
Please note that when I tried to do this, Visual Studio complained that there were no configurations in the project. An example of how I tried to achieve it is given below. Thanks in advance.
configurations.props:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug_Unicode|Win32"> <Configuration>Debug_Unicode</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> ... </ItemGroup>
projected:
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Label="Globals"> <ProjectName>projname</ProjectName> <ProjectGuid>{XXX...XXX}</ProjectGuid> <RootNamespace>proj</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="configurations.props" /> <PropertyGroup Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="PropertySheets"> <Import Project="other.props" /> </ImportGroup> ...
source share