Reputation: 1231
A found an article (Extend the Visual Studio Build Process) that explained how to override build targets in a C# project file. I tested this, and it seems to work well. However, what I really want to do is override a build target in a C++ project (with Visual Studio 2005). The problem is that C++ projects use different XML. Instead of having <project>
as the root, C++ projects have <VisualStudioProject>
as the root. When I add the <target>
tag to a C++ project file and try to open the project in Visual Studio, I get this error:
The following error has occurred during XML parsing:
File: [Path to Project File].vcproj Line: 304 Column: 30 Error Message: Element 'Target' is unexpected according to content model of parent element 'VisualStudioProject'.
The file '[Path to Project File].vcproj' has failed to load.
How can I override a Visual Studio build target for a C++ project? Or is there a better way to customize what happens during a C++ build?
Upvotes: 0
Views: 554
Reputation: 38795
In Visual Studio 2005 there are no build "targets" for C++ builds as the C++ build system does not use MSBuild.
However, VC++2005 defines the Pre-Build, Pre-Link, Post-Build Events as well as the ability to add a Custom Build Step for non-standard files.
You may be able to achieve what you want using these settings.
Note:
Upvotes: 1