alternative library names?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

alternative library names?

Nico Schlömer-3
Hi,

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.

How would you deal with this is CMake?

Cheers,
Nico
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: alternative library names?

Tyler Roscoe
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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: alternative library names?

Michael Wild
In reply to this post by Nico Schlömer-3
On 15. Jul, 2009, at 18:42, Nico Schlömer wrote:

> Hi,
>
> 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.
>
> How would you deal with this is CMake?
>
> Cheers,
> Nico
>


How about this?

find_library( FOOBAR_LIBRARY NAMES foobar myfoobar yourfoobar )


HTH

Michael

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: alternative library names?

Tyler Roscoe
On Wed, Jul 15, 2009 at 06:56:40PM +0200, Michael Wild wrote:
> find_library( FOOBAR_LIBRARY NAMES foobar myfoobar yourfoobar )

I was faster, but this is better :).

tyler
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: alternative library names?

Nico Schlömer-3
In reply to this post by Nico Schlömer-3
Alright, after having found

http://www.cmake.org/cmake/help/cmake2.6docs.html#command:find_library

aka tfm (as is rtfm) is was pretty straightforward. Sorry for the noise!

Cheers,
Nico


On Wednesday 15 July 2009 18:42:20 you wrote:

> Hi,
>
> 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.
>
> How would you deal with this is CMake?
>
> Cheers,
> Nico

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Loading...