Qt5config.cmake error when downloading to apple silicon device

The instruction here:

7) Define the PKG_CONFIG_PATH environment variable for Qt 5 by typing in the terminal:

export PKG_CONFIG_PATH=/opt/homebrew/Cellar/qt@5/5.15.2_1/lib/pkgconfig/
export PATH=/opt/homebrew/Cellar/qt@5/5.15.2_1/bin:$PATH

is dependent on whether you have that exact version of the qt@5 formula installed (and brew currently ships 5.15.8). It’s cleaner to do:

export PKG_CONFIG_PATH=/opt/homebrew/opt/qt@5/lib/pkgconfig/
export PATH=/opt/homebrew/opt/qt@5/bin:$PATH

which doesn’t depend on the version. Alternatively, use the CMAKE_PREFIX_PATH variable

export CMAKE_PREFIX_PATH="/opt/homebrew/opt/qt@5:$CMAKE_PREFIX_PATH"

as outlined in the Installation Guide.

1 Like