Question

Could anyone provide any example of NAnt script for C++ project build automation?

Thanks!

Was it helpful?

Solution

If you're talking Microsoft Visual C++ then I think you get the most control by shelling out msbuild.exe from the nant script and passing it your solution file on the command line. This is supported in Visual Studio 2005/.Net Framework 2.0 and above. e.g.:

<property name="msbuild.dir" value="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" />

...

<exec program="${msbuild.dir}\MSBuild.exe"
    commandline="/p:Configuration=Release .\MySolution.sln" 
/>

It will build everything in your solution regardless of language (c#, VB, C++, etc)

Mike

OTHER TIPS

If the project is in Visual Studio then you can use the <Solution> task, I think. That's the simplest/ugliest way of doing it.

edit: Just realised that SO filtered out my little XML tag there.

I was recently looking for this kind of information, and found this blog entry about it: http://seclib.blogspot.com/2005/05/building-native-c-projects-with-nant.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top