[CMake] question on pkg_check_modules()

Philip Lowman philip at yhbt.com
Sun May 11 14:02:51 EDT 2008


On Fri, May 9, 2008 at 7:04 PM, Philip Lowman <philip at yhbt.com> wrote:

> On Fri, May 9, 2008 at 4:12 PM, Alexander Neundorf <
> a.neundorf-work at gmx.net> wrote:
>
> > On Friday 09 May 2008, Philip Lowman wrote:
> > > Should the pkg_check_modules() included with CMake 2.6.0 in
> > > FindPkgConfig.cmake return full path declarations for
> > <XPREFIX>_LIBRARIES
> > > and <XPREFIX>_STATIC_LIBRARIES instead of just NameA;NameB;NameC ?
> > >
> > > This would make an extremely useful feature in my book in trying to
> > port
> > > stuff to CMake 2.6.0.  Anyone else agree?
> >
> > Yes, I do.
>
>
> I implemented it.  I could use feedback and testing.  It seems to work
> fine for me and plays very nicely with CMake's new file-extension based
> find_library support and full path target_link_libraries support.  Here are
> the changes:
>
> 1.  <XPREFIX>_LIBRARIES is now <XPREFIX>_LIBRARIES_NOPATHS.
>

I'm starting to have second thought about this change.  It will cause
backwards compatibility issues if someone is doing something like this:

LINK_LIBRARIES(/my/custom/path )  # custom path instead of the path provided
by FindPkgConfig
TARGET_LINK_LIBRARIES(foo <XPREFIX>_LIBRARIES)

I suppose that the proper thing to do is modify the patch so
<XPREFIX_LIBRARIES> remains unchanged and a new variable is used for the
full paths like <XPREFIX>_LIBRARIES_FULLPATHS or something like that?
Comments?

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080511/95a51075/attachment.htm>


More information about the CMake mailing list