A common way to use pkg-config in makefiles is as follows:
gcc -o test test.c `pkg-config --libs --cflags glib-2.0`
in this case, a test application using glibs will get all the proper paths for include headers and libraries with such command. Now moving into a Qt project, it's even easier (no need to run external program pkg-config) as qmake will take care of all the required stuff given you ask it to rely on pkg-config for a desired package (in the example, the OpenCV library):
# includes and libraries for OpenCV unix { CONFIG += link_pkgconfig PKGCONFIG += opencv }
No comments:
Post a Comment