pkg-config使用

pkg-config用来得到已安装library的信息,这些信息从扩展名为.pc的文件中获得。事实上,pkg-config从prefix/lib/pkgconfig目录中查找这些.pc文件,同样也可以向PKG_CONFIG_PATH环境变量中指定。下面是一个.pc文件的例子:

 

# This is a comment
prefix=/home/hp/unst   # this defines a variable
exec_prefix=${prefix}  # defining another variable in terms of the first
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: GObject                            # human-readable name
Description: Object/type system for GLib # human-readable description
Version: 1.3.1
URL: http://www.gtk.org
Requires: glib-2.0 = 1.3.1
Conflicts: foobar <= 4.5
Libs: -L${libdir} -lgobject-1.3
Libs.private: -lm
Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib/include

你可能感兴趣的:(pkg-config使用)