[Qt5-feedback] Build system requirements for Qt5

Alexander Neundorf neundorf at kde.org
Thu Jun 9 14:29:16 CEST 2011


On Thursday 09 June 2011, Thiago Macieira wrote:
> On Thursday, 9 de June de 2011 13:56:21 Alexander Neundorf wrote:
> > One more thing which is global in cmake is targets.
> > Targets need unique names in a cmake project.
> > 
> > You can create a library in some subdirectory and link against it in
> > other directories, not only subdirectories of that one.
> > 
> > To me, this sounds very useful.
> 
> It is.
> 
> So why did we need add_subdirectory (ordered subdirectories) in KDE?

Because in cmake a target can't be used (e.g. in target_link_libraries()) 
before it has been created (using add_library()).

So it was necessary to make sure that the directory which creates the library 
has been processed first before other code (e.g. target_link_libraries() ) is 
executed.

Being able e.g. to set properties on a not yet existing target would be nice.

With some work it might be possible (I'm not at Kitware and I won't do it) to 
change that so that in a first pass everything is collected, and in a second 
pass then targets are "resolved".

Alex



More information about the Qt5-feedback mailing list