[原创]自定义VS2010项目文件vcxproj动态管理inc lib

[原创]自定义VS2010项目文件vcxproj动态管理inc lib

2011-12-15 20:02 Scott Guthrie Liu 阅读(934) 评论(0) 编辑 收藏

.vcxproj 是关键
A guide to .vcxproj and .props file structure
基本框架

.vcxproj基本框架

复制代码

<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns='http://schemas.microsoft.com/developer/msbuild/2003' > 
 <ItemGroup Label="ProjectConfigurations" />  
<PropertyGroup Label="Globals" />  
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" /> 
 <PropertyGroup Label="Configuration" /> 
 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 
 <ImportGroup Label="ExtensionSettings" />  
<ImportGroup Label="PropertySheets" />  
<PropertyGroup Label="UserMacros" />  
<PropertyGroup />  
<ItemDefinitionGroup /> 
 <ItemGroup /> 
 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />  
<ImportGroup Label="ExtensionTargets" /></Project>

复制代码

基本框架解释

基本框架解释

复制代码

<!-- This is the root node. It specifies the MSBuild version to useand also the default target to be executed when this file is passedto MSBuild.exe -->
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns='http://schemas.microsoft.com/developer/msbuild/2003' > 
 <!-- This contains the project configurations known to the project  (such as Debug|Win32 and Release|Win32). --> 
 <ItemGroup Label="ProjectConfigurations" />  
<!-- This contains project level settings such as ProjectGuid,  RootNamespace, etc. These properties are not normally overridden  elsewhere in the project file. This group is not configuration  dependent and so only one Globals group generally exists in the  project file. -->  
<PropertyGroup Label="Globals" /> 
 <!-- This property sheet contains the default settings for a VC++  project. It contains definitions of all the project settings such  as Platform, PlatformToolset, OutputPath, TargetName, UseOfAtl,  etc. and also all the item definition group defaults for each known  item group. In general, properties in this file are not tool-specific. -->  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />  
<!-- This property group has an attached configuration condition  (such as Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'")  and comes in multiple copies, one per configuration. This property  group hosts configuration-wide properties. These properties control  the inclusion of system property sheets in Microsoft.Cpp.props.  E.g. if we define the property <CharacterSet>Unicode</CharacterSet>,  then the system property sheet microsoft.Cpp.unicodesupport.props  will be included (as can be seen in the Property Manager). Indeed,  in one of the imports of Microsoft.Cpp.props, we can see the line:  <Import Condition="'$(CharacterSet)' == 'Unicode'"   Project="$(VCTargetsPath)\microsoft.Cpp.unicodesupport.props"/> -->  
<PropertyGroup Label="Configuration" />  
<!-- This property sheet (directly or via imports) defines the  default values for many tool-specific properties such as the  compiler’s Optimization, WarningLevel properties, Midl tool’s  TypeLibraryName property, etc. In addition, it imports various  system property sheets based on configuration properties defined  in the property group immediately above. -->  
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 
 <!-- This group contains imports for the property sheets that  are part of Build Customizations (or Custom Build Rules as this  feature was called in earlier editions). A Build Customization  is defined by up to three files – a .targets file, a .props file  and .xml file. This import group contains the imports for the .props file. -->  <ImportGroup Label="ExtensionSettings" />  
<!-- This group contains the imports for user property sheets.  These are the property sheets you add through the Property  Manager view in VS. The order in which these imports are listed  is relevant and is reflected in the Property Manager. The project  file normally contains multiple instances of this kind of import  group, one for each project configuration.  -->  
<ImportGroup Label="PropertySheets" /> 
 <!-- UserMacros are as variables used to customize your build  process. E.g. you can define a user macro to define your custom  output path as $(CustomOutpuPath) and use it to define other  variables. This property group houses such properties. Note that  in VS2010, this group is not populated by the IDE since we do not  support user macros for configurations (we do for property sheets  though). -->  
<PropertyGroup Label="UserMacros" />  
<!-- This property group normally comes with a configuration  condition attached. You will also see multiple instances of the  property group, one per configuration. It differs in its identity  from the other property groups above by the fact that it does  not have a label (to look at it in another way, it has a label  that is equal to the empty string). This group contains project  configuration level settings. These settings apply to all files  that are part of the specified item group. Build Customization  item definition metadata also gets initialized here. --> 
 <PropertyGroup />  
<!-- Similar to the property group immediately above, but it  contains item definitions and item definition metadata instead  of properties. -->  
<ItemDefinitionGroup />  
<!-- Contains the items (source files, etc.) in the project.  You will generally have multiple item groups – one per item  type. -->  <ItemGroup /> 
 <!-- Defines (directly or via imports) VC++ targets such as  build, clean, etc. -->  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />  
<!-- This group contains imports for the Build Customization  target files. -->  <ImportGroup Label="ExtensionTargets" />
</Project>

复制代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lst0426

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值