pkg-config doesn't come stantdard with Mac OSX (10.8.4). For my Qt project I wanted to use pkg-config to link in protocol-buffer, so that it would be portable. The very point of choosing Qt was to have a portable app in the first place.
However, qmake would not let me use pkg-config. Linking libraries to a QT project using pkg-config output gives a simple recipe that should work. But it doesn't
with CONFIG += link_pkgconfig
PKGCONFIG += protobuf
I'm getting the error Project ERROR: Package protobuf not found
Eventhough pkg-config and protobuf are installed using homebrew and in path. And the problem is with all pkg-config packages.
qmaketest$which pkg-config
/usr/local/bin//pkg-config
qmaketest$pkg-config --cflags --libs libssl
-lssl -lcrypto -lz
qmaketest$cat project.proj
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = project
TEMPLATE = app
SOURCES +=
HEADERS +=
FORMS +=
OTHER_FILES +=
CONFIG += link_pkgconfig
PKGCONFIG += libssl
qmaketest$/Applications/Other/Qt5.0.2/5.0.2/clang_64/bin/qmake project.proj
Project ERROR: Package libssl not found
When I dug deeper I found a solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…