I needed to build my software for several different platforms using Microsoft Visual C++ 2010 and MSBuild. I added the platforms to the $(VCTargetsPath) directory and created the .props and .targets files. I then copied the files to my configuration management repository, defined a path to the parent directory for the copied files: $(CM_REPO_PATH), and wanted to redirect visual studio to use the files in the repository.
I am able to get the project to work when I create an environment variable on my machine called %MSBuildExtensionsPath% and point it to $(CM_REPO_PATH)\MSBuild. What I want, though, is to set the $(VCTargetsPath) and/or $(MSBuildExtensionsPath) within the visual studio project, not in an environment variable on every developer's machine.
When I add the property group to do this...
<PropertyGroup>
<VCTargetsPath>$(CM_REPO_PATH)\MSBuild\Microsoft.Cpp\v4.0</VCTargetsPath>
<MSBuildExtensionsPath>$(CM_REPO_PATH)\MSBuild</MSBuildExtensionsPath>
<MSBuildExtensionsPath32>$(CM_REPO_PATH)\MSBuild</MSBuildExtensionsPath32>
</PropertyGroup>
...the new platforms are not available (as if the project is still using the default $(VCTargetsPath), rather than the one specified). Is there a way to override the $(VCTargetsPath) from the project file?