Skip to content

PKG-CONFIG and CMAKE

When a library installed, it has include files and static or dynamic libraries. For making new programs in C++, in compile level, include files and in link level, libraries are necessary. There might be hundred library files. Makefiles cannot be written manually to cover all dependencies. Also, putting all dependencies in environment variables makes the environment very busy.

Better solutions are pkg-config and cmake files. pkg-config files (.pc) are simple data files which usually will distribute or generate automatically in famous packages. They combine with pkg-config command to produce the necessary command line for to compile and link. cmake files are usually used with cmake command to produce Makefiles automatically.

For information about pkg-config the following link is very declarative:

https://people.freedesktop.org/~dbn/pkg-config-guide.html

And for cmake:

Published inTools

Be First to Comment

Leave a Reply