Since I write a command line program to check cpp files, and it need lib path and include path of those cpp files. How can I get the include and lib path info from visual studio project? Our project uses property sheets to make up those information.
A:
Check out the Visual Studio project files - they're typically only XML files, so you should be able to extract out whatever you need from those, really. Just a matter of understanding and parsing your XML contents in the project file, really.
marc_s
2010-04-01 05:59:53
A:
It is made up from 3 distinct sources:
- Tools + Options, Projects and Solutions, VC++ Directories. In turn built up from several registry keys
- the settings in your .vsprops project property sheets
- the settings in your .vcproj project
The first part is the hardest, you can get it by running vc\vsvarsall.bat. The .vsprops and .vcproj files are XML, easy to parse.
If you just want to find out what the command line should look like then you can get it from the buildlog.htm file, produced when building from the IDE. Or you could use vcbuild.exe on the command line to build your project from the .vcproj file. Or you could build using devenv.exe /build.
Hans Passant
2010-04-01 08:43:57