[CMake] How to properly write a Module/<Package>Config.cmake file

Andreas Pakulat apaku at gmx.de
Mon Nov 24 11:49:25 EST 2008


On 24.11.08 18:23:09, Ioan Calin Borcoman wrote:
> Why not provide a pkg-config .pc file that can be used by your users?
> 
> The syntax of .pc files is quite simple and your user can use
> pkg_check_module once the .pc is installed (or even use some some
> other build system that knows how to handle pkg-config, like
> autotools).

Because pkg-config uses compiler switches in its files, so you always have
to remove those, then compute absolute paths to the library files. And you
need to get the order of the -L's right too. Thats a lot work, if all of
that can be skipped with a proper FooConfig.cmake.

Andreas

-- 
Your true value depends entirely on what you are compared with.


More information about the CMake mailing list