Newbie MSBuild question

M

minorguy

I have a general question about MSBuild (which I know little about so far)
and I hope this is the right newsgroup. I can read the reference
documentation about MSBuild, but it's not really telling me what I want to
know. Perhaps someone can point me in the right direction.



We have several projects, mostly C++, that we develop with Visual Studio
2005. I would like to automate this process. All of the targets, executables
and DLLs, need to be built and then copied along with other files to a final
directory somewhere to form the final product. Ok, that much seems easy
enough. I presume I can call MSBuild from some script language or even C# to
automate things. I don't think I need to manually create an MSBuild project
file because we work from within the VS2005 IDE just fine.



But in order to copy the target file after it's been built, I need to know
where it is. How can I know from the automation point-of-view? Often, when
we work and debug from the VS2005 IDE we'll set the output directory to
C:\Windows\system32 for convenience because that's where the file installs
to in the final product, so the compile/debug cycle is easier. Or we may
not. Or we may change the output filename.



So from the automation/build point-of-view, I need to find the output file
for any given project programmatically. So far, the only way I can see to do
this is to parse the .proj file. But even then it's not so straightforward.
Sometimes that info isn't in the .proj file at all if you've left the linker
output file setting to the default. Or, another alternative would be to
override just the linker output file location when building from MSBuild. Is
that possible?



I get the feeling may going about this from the wrong direction. Am I? What's
the best way to approach this?



Thanks for any comments.
 
C

Cor Ligthert [MVP]

Minorguy,

You are in a right newsgroup, however a better change on your quiet extended
question you have in the newsgroup.

Microsoft.public.dotnet.languages.vc

There are *more* specialized C++ guys and girls.

Succes

Cor
 
M

minorguy

Sayed Ibrahim Hashimi said:
Hi,
I hate to break this to you but MSBuild doesn't build C++ projects.
vcbuild.exe is used in this process.

Sayed Ibrahim Hashimi
www.sedodream.com

Vcbuild.exe is one of the tools that get invoked by MSBuild. I can type the
following on the command line and it will build my C++ program using
vcbuild.exe:



msbuild MyApp.sln /p:Configuration=Release /t:Rebuild



But I'll repost on microsoft.public.dotnet.languages.vc
 
M

minorguy

Cor Ligthert said:
Minorguy,

You are in a right newsgroup, however a better change on your quiet
extended question you have in the newsgroup.

Microsoft.public.dotnet.languages.vc

There are *more* specialized C++ guys and girls.

Succes

Cor

Thank you. I'll try there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top