Proper command line build of a KDevelop project

Andreas Pakulat apaku at gmx.de
Tue May 29 20:47:00 BST 2007


On 29.05.07 20:06:33, Kovacs Peter Tamas wrote:
> >On 29.05.07 18:46:24, Kovacs Peter Tamas wrote:
> >>The trick done by KDevelop is that it supplies the flags when running 
> >>configure. But how can I do the same from the command line? (I mean, without 
> >>parsing the kdevelop file and supplying the parameters with a script).
> >>    
> >
> >Well, if the flags are fixed for debug and optimized you could
> >"hardcode" them and supply them also on the commandline via
> >
> >CXXFLAGS="foo" LD_FLAGS="bar" ../configure
> >  
> This is exactly what I've done until this time, but since we have multiple 
> projects, I use the same autobuild script for all of them (for easy 
> maintainability, I just supply SVN repository name, target dir on the server, 
> email of developers to warn on error, etc..), and they use different compiler 
> switches, this is not enough.

Well, you can really easily parse the .kdevelop file and extract the
flags from that.

> What I would like to have is something like I do with visual studio, I just say 
> this in my script:
> devenv project.sln /build configurationName /out build.log
> and everything is build exactly as I pressed the build button.
> I thought the command line way of doing this must be just as easy on Linux :)
> I just cannot find the proper command line after several hours of googling.
>
> Is there any other way?

Sure, but you'd need to add support for that in your buildsystem files
(as is done on Windows with VS, where all the specifics of each
configuration is stored in the VS "buildsystem" files). Write an
autoconf macro that sets the CXXFLAGS and LDFLAGS as needed depending on
wether --enable-foo was given to configure or not. For example to switch
between debug and non-debug build all you need to do in many autofoo
projects is supplying --enable-debug or --disable-debug.

Andreas

-- 
You will gain money by a fattening action.




More information about the KDevelop mailing list