[CMake] How to find a specific version of a library?

Yaron Cohen-Tal yaronct at gmail.com
Sun Jul 19 08:02:17 EDT 2015


Ok, I get it. But I still don't understand (and this has nothing to do with
CMake) why is it so that "By convention only one version within that prefix
may be available for development at a time". If I want to develop one
project that uses GLFW 2 and one project that uses GLFW 3, I need to have
both installed. I could just link one project with "libglfw.so.2" and the
other with "libglfw.so.3". But my system (Debian) doesn't let me do that,
as the development packages of GLFW 2 and GLFW 3 conflict (they both
contain the symlink "libglfw.so"). Do u have any idea why it's like that,
and if it has a workaround? (Other than building from source)

On Sun, Jul 19, 2015 at 1:06 PM, Nils Gladitz <nilsgladitz at gmail.com> wrote:

> On 19.07.2015 08:38, Yaron Cohen-Tal wrote:
>
>> Hi,
>>
>> For example, I currently have both versions 2 and 3 of the GLFW library
>> installed on my Linux computer, named "libglfw.so.2" and "libglfw.so.3". Is
>> it possible to tell CMake to find a specific version of GLFW (say, version
>> 3), and it would be smart enough to look for "libglfw.so.3" or
>> "libglfw.so.3.*" or "libglfw.so.3.*.*"? (Or something equivalent in Mac and
>> Windows)
>>
>
> Those are SONAMEs of the library intended for the runtime loader.
> Any number of those may be present in the same installation prefix to
> satisfy runtime dependencies.
>
> By convention only one version within that prefix may be available for
> development at a time.
> For that a symlink from libglfw.so to the actual library will be present
> and required header files matching that version will be present.
>
> Hence libglfw.so is intended for development and its presence implies that
> appropriate headers should be available as well.
> The sole presence of libglfw.so.2 or libglfw.so.3 neither implies that
> headers will be available nor do you know which of those versions those
> headers would be for.
>
> Nils
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150719/a5d19b24/attachment.html>


More information about the CMake mailing list