Building slicer with system QT

Slicer developers recommend building against Qt5.

On my host running Arch Linux, the following configuration builds nicely :

cmake -DSlicer_VTK_VERSION_MAJOR:INT=9 -DQt5_DIR:PATH=/usr/lib/cmake/Qt5 -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=0 -DBUILD_TESTING:BOOL=0 -DCMAKE_BUILD_TYPE:STRING=Release …/Slicer

You should adapt Qt5_DIR parameter to your distribution.

If you really want Qt4, I guess you’ll be having a hard time and few help. In any case, Qt4 support is scheduled to be deprecated, as far as I understood.