Re: vcbuild usage questions
<jpetrang@harris.com> wrote in message
news:1154380606.353719.273830@i42g2000cwa.googlegroups.com...
Hi,
I am trying to convert a VS 6.0 application to VS2005, and I want to
see if I can use the lighter-weight vcbuild.exe. As I understand it,
the .dsw/.dsp files of VS6 are the .sln/.vcproj files with VS2005, so
what I need to do is to open a .dsw in VS2005, at which time the .sln
and .vcproj files will be created and put somewhere, if not in the same
place as the .dsw/.dsp files. Then, I need to translate my msdev
command lines in my nmake makefiles to use vcbuild.
I found one old post in an MSDN forum for Visual C++ that said in order
to build a particular project within a solution, I would use syntax
like this:
vcbuild ProjectName.vcproj "Release|Win32"
But when I look up vcproj in the help files, I find a note saying
vcproj files are not compatible with nmake!! At first I interpreted
that to mean that the above line is invalid from within an nmake
makefile. Since then I've read that nmake knows nothing about .vcproj
files, which means I "can't get nmake to invoke vcbuild only when the
project actually needs to be built, as the dependency information
doesn't exist in a form that nmake can understand". [Thanks, Carl
Daniels.]
So I am still a bit confused... what good is nmake if I can't use it to
build the project? What is it used for? Can I use that above line in an
nmake makefile to build the ProjectName project?
Yes, and that's about all you can do with nmake and .vcproj files without
doing extra work. If you want to have a makefile with full dependency info,
you'll have to find or create a tool to write a makefile for your project
(or worse, write the makefile by hand). Under VC6, the ".dsp" file was
basically a makefile, so the conversion to makefiile form was almost a
no-op. Under VC7+, the .vcproj file is an XML file, so converting to a
makefile is considerably more involved. When VC7 was designed, they chose
to eliminate the "generate makefile" option for one main reason: The
generated makefiles frequently didn't work, since they didn't capture any of
the information implicit in the environment or in the Tools|Options
settings.
My goal is to have an automated build environment where I can check out
the source files from version control, type "nmake MyApp", and then the
app's executable will be generated. Would I need to use the IDE to
build the app, check in the files (with .sln/.vcproj), then anyone
could check out the files and "nmake MyApp" to create the MyApp.exe?
Yes - use the IDE to convert your .dsw/.dsp to .sln/.vcproj and check those
in. If you write a simple nmake makefile that just always invokes vcbuild
with the correct options then anyone with visual studio 2005 installed could
build your app with "nmake MyApp".
You might also want to check out some of the build automation products that
are out there - one that I've used and that I'm very happy with is
FinalBuilder - www.finalbuilder.com. That gives you a nice GUI environment,
and FB already has good integration with visual studio and most common
source control systems, including VSS and Team System.
-cd