[CMake] FIND_LIBRARY in FindBoost finds wrong library

Marcel Loose loose at astron.nl
Thu Mar 18 09:47:16 EDT 2010


Hi all,

I ran into a problem with FindBoost where it fails to find the correct
version of a component library. The cause is pretty clear to me.

There's a system-wide (rather old) version of Boost installed and
there's my latest-greatest version of Boost. The FindBoost macro
searches for a library using rather specific names first and generic
names last. These are all listed under NAMES. FIND_LIBRARY() tries to
find each name in all paths specified under PATHS. 

Problem is that (for reasons I do not really know) the very specific
library name is not present in my latest-greatest directory, but it IS
present in /usr/lib. 

This problem is closely related to a post on this list a couple of
months ago: http://www.mail-archive.com/cmake@cmake.org/msg24565.html
Unfortunately, no-one ever replied to that post.

Basically, the author of that post suggested to turn the loop in
cmFindLibraryCommand::FindNormalLibrary() inside out: i.e.
for(path in paths)
{
  for(name in names)
  {
    find name in path;
    if found return name;
  }
}

Any thoughts on this?

Best regards,
Marcel Loose.



More information about the CMake mailing list