pkg-config files

Alexander Neundorf neundorf at kde.org
Fri Dec 27 10:57:30 UTC 2013


On Thursday 26 December 2013, Alex Merry wrote:
> How much do we care about users of frameworks who don't use CMake?  Do
> we want to provide pkg-config files?  How easy is it to do so?
> 
> (My personal answers would be: enough to put in a little effort, but not
> a huge one; yes, if it's easy; there is probably a helpful macro, and if
> not ECM would benefit from one).
> 
> Alex
> 
> PS: I'm just throwing out things while I think of them, but these
> questions don't need to be answered before TP1 :-)

a year ago or a bit earlier I added a --find-package <PackageName> option to 
cmake, the idea was that it can be used the same way as pkgconfig by projects 
which do not use cmake.
This basically used a find_package() call and printed the resulting include 
dirs/libs (via using the result-variables) to stdout so it can be used 
directly in makefiles.

This is working so-so, since find-modules can do various things, and not all 
of them work this way.
This could work much better by limiting this feature to CONFIG mode, telling 
cmake whether it should look for result-variables or imported targets, and 
depending on that, either print the variable or a target property.
This way cmake's config files could be of use to any other non-cmake using 
project.
$ cmake --find-package -DNAME=JPEG -DCOMPILER_ID=GNU -DLANGUAGE=CXX -
DMODE=LINK   
   -rdynamic -ljpeg 
$ 

(if you leave off arguments, cmake tells you what's missing. The other MODE is 
"COMPILE").

So, this would need some work in cmake, but I don't have the time to do that 
now.

Alex


More information about the Kde-frameworks-devel mailing list