Adding / usr / local / bin (homebrew) to the QtCreator search path for pkg-config on Mac OSX

Customization

  • Using Qt Creator on the Mac OSX Mountain Lion.
  • Installed packages in / usr / local using homebrew.
  • / usr / local / bin / pkg-config exists.
  • Do you want to use pkgconfig through the project file

-

QT_CONFIG -= no-pkg-config CONFIG += link_pkgconfig PKGCONFIG += protobuf #Or whatever package you want to try. 
  • / usr / local / bin is on the way when I run /Applications/Other/Qt5.0.2/5.0.2/clang_64/bin/qmake myproject.pro It works fine.
  • When I try to create a project through Qt Creator, I see a sh: pkg-config: command not found error, and the build fails.
  • I already tried launchctl setenv PATH $PATH as suggested in environment variables on Mac OS X

Does anyone know how to do this?

+6
source share
1 answer

As I have done so far, in the qmake project file, I hardcoded the pkgconfig path

 mac { PKG_CONFIG = /usr/local/bin/pkg-config } 

I hope to find a more elegant solution someone can provide.

+5
source

Source: https://habr.com/ru/post/947383/


All Articles