[CMake] [RFC] How to use pkg-config under Windows (... and OSX)?

Rolf Eike Beer eike at sf-mail.de
Thu Nov 17 15:21:58 EST 2011


Am Donnerstag, 17. November 2011, 14:36:00 schrieb David Cole:
> On Thu, Nov 17, 2011 at 2:06 PM, Alexander Neundorf
> 
> <a.neundorf-work at gmx.net> wrote:
> > On Thursday 17 November 2011, David Cole wrote:
> > ...
> > 
> >> If a project does something like this (distributes a file with
> >> build/install time information in it) but then lets the end user of
> >> the binary installation put it wherever they please...... then the

> I think we should completely ignore pkg-config on the grounds that
> their packages are not re-locatable, yet there are some packages that
> allow relocation anyhow. It should simply be made clear to everyone
> that pkg-config packages must not be, cannot be relocated.

> But..... if you insist on supporting pkg-config to appease those who
> would use it anyway despite this limitation, then I would vote for
> something like this:
> 
> if(NOT DEFINED CMAKE_USE_PKGCONFIG)
>   # Default to using it:
>   set(CMAKE_USE_PKGCONFIG 1)
>   # But not on Mac or Windows, where end-user relocation is common practice:
> if(APPLE OR WIN32)
>     set(CMAKE_USE_PKGCONFIG 0)
>   endif()
> endif()
> 
> if(CMAKE_USE_PKGCONFIG)
>   pkgconfig stuff...
> endif()

Or something different: in case we suspect a broken platform, or 
CMAKE_PKGCONFIG_OVERRIDE_${PACKAGE} is set, try to replace the prefix returned 
by pkgconfig with the prefix of the .pc file.

Or simply ignore the results pkgconfig returns if those files do not exist.

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111117/83cfd5d4/attachment.pgp>


More information about the CMake mailing list