简体   繁体   English

VC ++项目类型

[英]VC++ project type

I'm developing a tool using native c++ and boost (on VC++2008) which takes a .vcproj file and generates an equivalant makefile. 我正在开发使用本机c ++和boost(在VC ++ 2008上)的工具,该工具接受.vcproj文件并生成等效的makefile。 I can't seem to find the type of the VS project build output in the .vcproj file (or in the other files for that matter). 我似乎在.vcproj文件(或与此相关的其他文件)中找不到VS项目构建输出的类型

I'm refering to the 我指的是

Project Properties > Config Properties > General > Project Defaults > Configuration type

Where does VS2008 store this config for VC++ projects? VS2008在VC ++项目中将此配置存储在哪里? What I need is to determine if the project is an executable or a library... 我需要确定项目是可执行文件还是库...

Thanks a lot in advance for your help :) 在此先感谢您的帮助:)

If you are reading the vcproj file as an XML document then you should see an element that looks something like this ... 如果您将vcproj文件作为XML文档读取,则应该看到一个看起来像这样的元素...

    <Configuration
        Name="Debug|Win32"
        OutputDirectory="$(SolutionDir)$(ConfigurationName)"
        IntermediateDirectory="$(ConfigurationName)"
        ConfigurationType="1"
        CharacterSet="1"
        >

The ConfigurationType attribute is what you are looking for I think. 我认为您正在寻找ConfigurationType属性。 Note that there is a separate Cpnfiguration element for each Configuration name (Debug, Release, etc.) and each Platform (Win32, x64, IA64, etc.) in your project. 请注意,项目中的每个配置名称(Debug,Release等)和每个平台(Win32,x64,IA64等)都有一个单独的Cpnfiguration元素。

The problem with reading and writing raw XML is that definitions can change over time. 读写原始XML的问题在于定义会随着时间而变化。 Not very likely with a released product like Visual Studio 2008. Perhaps not even likely in a future Visual Studio release, but not impossible. 对于像Visual Studio 2008这样的发行产品来说,可能性很小。在将来的Visual Studio版本中,可能性很小,但并非不可能。

You might be better using the VCConfiguration object to manipulate the ConfigurationType property to achieve your ends. 使用VCConfiguration对象来操纵ConfigurationType属性来达到目的可能会更好。

I think it's the 我认为是

VisualStudioProject/Configurations/Configuration/ConfigurationType

attribute in the vcproj. vcproj中的属性。 It looks like "1" for a .dll and "4" for a .exe 对于.dll,它看起来像“ 1”,对于.exe,它看起来像“ 4”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM