[Lazarus] Project Group support in the IDE

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Sep 14 23:55:26 CEST 2013


> Marc Santhoff <M.Santhoff at web.de> hat am 14. September 2013 um 18:48 geschrieben:
>[...]
> > > Curiously asked: could a package and lazbuild be used for this task?
> > 
> > lazbuild can compile a project, but error messages might be
> > misunderstood by the IDE.
> 
> OK, as I wrote, for releases and similar I prefer console or xterm. And
> having things scriptable allows for including configuration files (e.g.
> serial number).

Maybe I was not clear:
You can perfectly compile projects with lazbuild in terminal.
And it is possible to call lazbuild as an external tool from the IDE to compile
a bunch of projects. This would allow to compile projects without switching the
active IDE project.
But if there is an error message the IDE interprets the messages using the
settings of the active project, which might lead to confusion.

  
> > > I don't know if packages can handle bulding executables. 
> > 
> > Yes.
> > But packages lack some features, so you have to do more manual work.
> 
> Can you name those missing features or give an example?

For example linker options, creating the application bundle, the windows
manifest file, updating the .res, which contains the version, language,
copyright and other information under Windows, the program icon.

 
> > > Maybe it would
> > > be easy to extend it doing a lot less work than having to write a GUI
> > > and lazarus extension for it.
> > 
> > That would only work if all projects use the same settings for all
> > packages.
> 
> Would it be possible to use "makefile chaining"?
> 
> What I want to say is:
> If a subdirectory has it's own makefile[.fpc], use that one instead of
> doing a normal build?

Yes, you can call 'make' instead of the compiler. The IDE uses that too. Just
put it into the compiler options.

 
> The chained makefiles would have to be named explicitely or detected
> while generating a makefile using lazbuild, though.
> 
> > > If I'm doing releases having to start lazarus, finding and opening the
> > > project, setting some config values, would all be far to many actions. I
> > > really prefer using makefiles or something similar. Using lazbuild would
> > > have the advnatage of being able to have the makefiles holding anything
> > > needed (compiler switches, etc.) generated.
> > 
> > AFAIK project groups is mostly a GUI feature. Compiling a bunch of
> > projects with lazbuild works since years.
> 
> I think my idea of project groups is far away from reality,. ;)
> 
> >From reading Graeme's mail it looked like he wanted to simplify the
> build process in the scope of one project having multiple exe files,
> where all of those exe files can have different compiler options on the
> depencies and he wants to build with -B.

The -B is automatically done by the IDE and lazbuild.
Compiling one project with different compiler settings can be done by switching
build modes and compiling via lazbuild or the IDE.

 
> The idea was to let lazbuild or lazarus generate the makefile for each
> exe or subproject (e.g. database framework) and at maximum have to write
> one master makefile chaining them together.

Yes, that would compile.
But if you call that master makefile from the IDE, the IDE does not know about
the different compiler settings and will have trouble understanding the
generated error messages.

 
> That's why I'm thinking about it, as said I often have to compile in
> serial number and other items indvidually per customer. So I'm doing a
> lot of scripting and a lot of scritpting documention. Optimizing this
> process by wrtiting less extra scripts and stuff is very attractive.


Mattias




More information about the Lazarus mailing list