[cmake-developers] Introducing targets in FindPkgConfig

Rolf Eike Beer eike at sf-mail.de
Mon Dec 22 10:39:02 EST 2014


Hi Daniele,

the feature about CMake language I probably hate most is link_directories(). 
Sadly one currently needs to use it when working with software dependencies 
imported from PkgConfig.

What I would like to get is the following: when a list of libraries and 
directories is returned by PkgConfig then for every of these libraries the 
absolute path to the library is determined using find_library() using the given 
directories as hints. With that, noone needs to use link_directories() 
anymore. Since this would introduce new behavior people would need to adapt 
their CMakeLists.txt to this new feature. Therefore I think it would be a good 
idea to expose this new information not by new variables, but using targets.

So if I search for OpenSSL using PkgConfig I would get a target 
PkgConfig::OpenSSL that I can link to, and that has the libraries, compile 
flags, include dirs and whatnot.

Sadly, I don't quite understand all the macros in FindPkgConfig.cmake. Can you 
either point me to the right place where I would hook up something like that 
or try doing it?

Greetings,

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20141222/273bf591/attachment.sig>


More information about the cmake-developers mailing list