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

Alexander Neundorf a.neundorf-work at gmx.net
Thu Nov 17 14:06:51 EST 2011


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

that's what I hear from our Windows developers.

> distributed files should not contain any build/install time
> information in them, 

But according to what I hard this is what is done...

> but rather should parse and use their actual end
> user install location if they need to provide that information on an
> end user's system.

...instead of this.
I also don't know whether pkgconfig supports something like $ORIGIN to 
reference its own location in pc-files, which might help.

> It sounds to me like pkg-config is simply not suitable for use with
> packages that may be installed/copied anywhere.

Same here.

> What is the problem we are trying to solve?

From my very private POV:
I'm reviewing the Find-modules we have in KDE.
Many of them do 

if(NOT WIN32)
   pkgconfig stuff...
endif()

Now, I do not know from personal experience whether this if() make sense or 
not.

If it does make sense, then it might make sense for any package. In that case, 
it would also make sense to have a global solution for this (like an option 
CMAKE_SKIP_PKGCONFIG_ON_WIN32), instead of having to put this if() in each and 
every Find-module.

If the if() doesn't make sense, then it can be simply removed, and pkgconfig 
is used everywhere. But our Windows developers said they don't want that.

OTOH, since the Find-module must also work without pkgconfig (since we cannot 
rely on that it exists everywhere), one could also argue that pkgconfig is 
unnecessary completely in Find-modules, but then another group of people 
starts complaining that we are ignoring existing standards and they really 
want to use pkgconfig.

So, what I'd like to get, is first some more opinions and experiences with 
this, and as result some reasonable guidelines how to use pkgconfig properly 
(or not).

Alex


More information about the CMake mailing list