[CMake] alternative library names?

Tyler Roscoe tyler at cryptio.net
Wed Jul 15 12:55:25 EDT 2009


On Wed, Jul 15, 2009 at 06:42:20PM +0200, Nico Schlömer wrote:
> I'm using CMake for a program that links against common libraries which may 
> happen to have different names on different architectures (e.g., libfoobar.a, 
> libmyfoobar.a, libyourfoobar.a,...).
> 
> Until now I was always searching for libs like this
> 
> ================= *snip* =================
> find_library( FOOBAR  foobar  HINTS /possible/path/to/lib/ )
> ================= *snap* =================
> 
> but that is obviously restrictive when it comes to the package name.

That sounds annoying. Is this Boost? :)

The best solution I can see would be to use (or write) a FindFoobar
module that understands all these different permutations and hides them
from a CMakeLists writer.

Alternately, just use a bunch of if(PLATFORM) with appropriate
find_library() commands in each one.

tyler


More information about the CMake mailing list