[CMake] Have an export file split in 2 parts? Need caused by a cmake bug?

Alexandre.Feblot at thomsonreuters.com Alexandre.Feblot at thomsonreuters.com
Tue Jul 7 09:00:08 EDT 2009


From: Alexander Neundorf [mailto:a.neundorf-work at gmx.net] 
Sent: Monday, 06 July 2009 21:52
 
> On Monday 06 July 2009, Alexandre.Feblot at thomsonreuters.com wrote:
> > Hi,
> >
> > I need to export() some libraries, but I need to have the part
> >
> > ADD_LIBRARY(xxxx STATIC IMPORTED)
> >
> > and the part
> >
> > SET_PROPERTY(TARGET xxxx APPEND PROPERTY IMPORTED_CONFIGURATIONS
> > RELEASE)
> >
> > SET_TARGET_PROPERTIES(xxxx PROPERTIES
> >   IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "yyyy;zzzz"
> >   IMPORTED_LOCATION_RELEASE "/path/to/libxxxx.a"
> >   )
> >
> > in different files, so that I can first add all libraries, and then
set
> > all their properties.
> > How can I do that?
> 
> I think this is not possible.

Too bad. Well I manage to split them manually (well, perl script), to
see if
it solves the issue. See below.

> 
> > WARNING: exporting all libs in a single export file is NOT an
option: I
> > may have to import later some of these libs, but not all of them, so
> > each of them must have it's own export file.
> 
> But you can export them in different export sets, so two different
sets of 
> libraries get installed with two different export files.
> 
> Would that help ?

No, that would not. I won't explain here why, but we may need any
combination of libs to be imported later on.


> > ROOT CAUSE of the question: when importing a number of libs (which
> > reference each other in the IMPORTED_LINK_INTERFACE_LIBRARIES) using
the
> > standard export files generated by cmake, it seems that libs found
in
> > the IMPORTED_LINK_INTERFACE_LIBRARIES are not taken into account if
they
> > have not been imported at that time (they are just understood as
> 
> If they have not been imported, then cmake cannot know that this
should be 
> also an imported target instead of just the name of a library. How
should 
> it ?
> Do I understand you correctly ?

That was my initial guess too, and that's the reason why I asked for a
way to split the 2 parts of the export file. 
Note that this seems strange though, as normal project targets would
work properly that way: You can reference a lib target as an executable
dependency before you create this library.

But after such a try, meaning, declaring all imported libs first, then,
setting their properties, and then, creating standard targets, it still
doesn't work.

I'll prepare a sample to post on the bugtracker, hoping you'll tell me
if it's really a bug, or how I should manage this.

This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.




More information about the CMake mailing list