[CMake] intercomponent link dependencies?

Ryan Pavlik rpavlik at iastate.edu
Wed Jan 13 12:02:09 EST 2010


On 1/13/10 7:22 AM, Jed Brown wrote:
> On Wed, 13 Jan 2010 07:04:46 -0600, Ryan Pavlik<rpavlik at iastate.edu>  wrote:
>    
>> You could use the CleanLibraryList module I posted a few emails ago:
>> just make a list that contains all the libraries you are going to link
>> your target against, and then just run clean_library_list on it before
>> doing so.
>>      
> The trouble is that the list of libraries is order-dependent so sorting
> them will definitely not work.  Furthermore, list (REMOVE_DUPLICATES
> lst) keeps the first copy and drops subsequent ones which means that
> some libs will be neglected.  If there are no dependency loops, you can
> reverse the list, REMOVE_DUPLICATES, and reverse it again (so that only
> the last occurrence of the library shows up).  If there are loops, the
> library will need to be explicitly linked more than once, but CMake does
> not retain sufficient information to determine when this is safe,
> therefore it cannot be provided as a general function (so you can only
> "clean" the list when you know that the underlying dependency graph is
> acyclic).
>
> Jed
>    
Ah, good to know - it worked with the library group I was configuring 
(which is indeed acyclic), so I didn't look any further into the 
"innards" of linking.  I will update my script accordingly.  Thanks!

Ryan


-- 
Ryan Pavlik
Human-Computer Interaction Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com/



More information about the CMake mailing list