[cmake-developers] General Config.cmake file issue on ArchLinux

Stephen Kelly steveire at gmail.com
Thu Dec 13 06:38:38 EST 2012


Alexander Neundorf wrote:

> On Thursday 06 December 2012, Stephen Kelly wrote:
>> Alexander Neundorf wrote:
>> > On Thursday 06 December 2012, Stephen Kelly wrote:
>> > ...
>> > 
>> >> I don't fully follow (too much 'the example' etc :)), but I guess it's
>> >> not too important. I think the two cases we're talking about are clear
>> >> 
>> >> * Installing to a location where one or more locations below
>> >> ${CMAKE_INSTALL_PREFIX} are symlinks
>> >> * Installing to a location where locations below
>> >> ${CMAKE_INSTALL_PREFIX} are not symlinks, but creating a symlink from
>> >> outside the prefix to inside it.
>> > 
>> > Should find_package() maybe check whether any of the directories in its
>> > search list actually refer to the same directory, and warn in this case
>> > ?
>> 
>> That could be a good idea if it can work.
> 
> I had a look at the code.
> The Config-searching code tries to look into a lot of directories, and
> stops when it finds the first good Config file.
> 
> To add such a check, this means once a good Config file has been found,
> basically cmake has to run again over all possible directories (i.e.
> without stopping after it has found something) and check for all existing
> directories whether they are a symlink to the Config file it has found.
> If so, print a warning.
> 
> This is quite some effort to generate a warning.
> 
> It may have a runtime effect, and it will also need quite some code.
> 
> I'm a bit hesitant to do that, if it is only for generating a warning...

Which code in particular did you look at? Presumably it is looping over 
directories and has a break. All you need to do is not break, but 'remember' 
which entry is the 'hit', and do the symlink checks if there has already 
been a hit. I'd be surprised if it's a big runtime hit or very complex code.

Thanks,

Steve.





More information about the cmake-developers mailing list