是否可以自定义内置的 Visual Studio 2010 C++项目向导?

发布于 2024-10-17 05:35:15 字数 117 浏览 4 评论 0原文

我需要制作一个与内置 C++ 向导相同的自定义 C++ 项目向导。哪种类型并不重要。它可能是控制台类型的项目。

我需要更改的只是添加自定义包含目录的路径和自定义库目录的路径。

我该怎么做?

I need to make a custom C++ project wizard that is the same as built in c++ wizard. It doesn't matter which type. It could be console type project.

What I need to change is only to add a path to custom include directory and a path to custom library directory.

How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧瑾黎汐 2024-10-24 05:35:15

我想你想研究一下项目模板。

http://msdn.microsoft.com/en-us/library/s365byhx.aspx

I think you want to look into project templates.

http://msdn.microsoft.com/en-us/library/s365byhx.aspx

我是男神闪亮亮 2024-10-24 05:35:15

这是编写新向导的链接
http://msdn.microsoft.com/en-us/library/7k3w6w59.aspx

我建议将这些类型的设置(例如自定义路径)存储在属性表中。 ( .props 文件。)然后您可以稍后改变主意并让此更改影响多个项目。您的向导只需将此 .props 文件添加到 .vcxproj 即可。我还更喜欢 .props 文件,因为您还可以定义 vcxproj 和其他 .props 文件可以使用的其他用户宏。

http://msdn.microsoft.com/en-us/library/a4xbdz1e.aspx

内置向导位于 [vsinstalldir]\vc\VCWizards\AppWiz 中
注册这些项目类型的其他文件位于 [vsinstalldir]\vc\VCprojects\ 中
您可以更改这些内容或复制它们以获得其余的 C++ 向导功能。

其他想法:

您可能会注意到,.vcxproj 通常具有如下所示的条目:

  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
        <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>

这意味着现有向导创建了一个尝试绑定到用户属性表(如果存在)的条目。

c:\users\<username>\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props

<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemDefinitionGroup>
     <ClCompile>
       <AdditionalIncludeDirectories>c:\Custom\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
   <ItemDefinitionGroup>
</Project>

我推荐第二个想法。添加包含、lib 路径和其他类型的设置是常见情况,现有向导通过引用用户属性表来实现此目的。

Here is a link to writing a new wizard
http://msdn.microsoft.com/en-us/library/7k3w6w59.aspx

I recommend storing those types of settings like custom paths in a property sheet. ( .props file.) Then you can change your mind later and have this change affect multiple projects. Your wizard could simply add this .props file to the .vcxproj. I also prefer .props files because you can also define additional user macro's that the vcxproj and other .props files can use.

http://msdn.microsoft.com/en-us/library/a4xbdz1e.aspx

The built-in wizards are found in [vsinstalldir]\vc\VCWizards\AppWiz
The additional files that register these project types are found in [vsinstalldir]\vc\VCprojects\
You could alter those or copy them to get the rest of the c++ wizard functionality.

Additional Idea:

You may notice that .vcxproj's typically have an entry like this:

  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
        <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>

This means that the existing wizard made an entry that tries to bind to a user property sheet if one exists.

c:\users\<username>\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props

<?xml version="1.0" encoding="utf-8"?> 
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemDefinitionGroup>
     <ClCompile>
       <AdditionalIncludeDirectories>c:\Custom\Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
   <ItemDefinitionGroup>
</Project>

I recommend the second idea. Adding include, lib path, and other types of settings are a common scenario and the existing wizard allows for this by having a reference to user property sheets.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文