Getting a "Qt 5.15 was not found on your system" error

Hello,

I’ve been trying to setup Slicer for local development, but I’m having trouble with Qt when going through the configuration step.

I’m running MacOS, and on the build instructions page(macOS — 3D Slicer documentation) there is a link for the Qt installer.

However, in the installer I wasn’t able to find Qt 5.15, even when enabling the archive filter, so I proceeded to install Qt using hombrew.

brew install qt@5

After installation, I tried running the configuration step, like so:

cmake \
  -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.0 \
  -DCMAKE_BUILD_TYPE:STRING=Debug \
  -DQt5_DIR:PATH=/opt/homebrew/opt/qt@5/5.15.13_1/lib/cmake/Qt5 \
  ~/Slicer

But I only run into this error:

CMake Error at CMake/SlicerBlockFindQtAndCheckVersion.cmake:30 (message):
  error: Qt 5.15 was not found on your system.You probably need to set the
  Qt5_DIR variable.
Call Stack (most recent call first):
  CMake/SlicerBlockFindQtAndCheckVersion.cmake:67 (__SlicerBlockFindQtAndCheckVersion_find_qt)
  CMakeLists.txt:695 (include)

I haven’t built from scratch on a mac in a while and probably the Qt5 version is updated, but usually there’s a specially named file that cmake is looking for (I thought it should be listed in the error message). You can investigate what that file is and make sure the Qt5_DIR variable points to it. You may need to read the cmake code to make sure

Thank you for the reply!
I’ll check the cmake files and see if I can figure it out.