Slicer3d compilation on Ubuntu 20.04 lts

I am trying to build slicer by compiling the source code. When I am building it through cmake command it’s saying that it requires atleast 5.15.1.

But when I am using qt-default , it’s not installing the required version. And when tried to install latest version(6.x) through qt-online installer,it’s installing in a custom directory and while building slicer it’s using the older version.How can I resolve this issue? Is there a way to specify qt directory when I am compiling slicer? Or there is a optimal way to resolve this issue?

You can work around this by setting Slicer_REQUIRED_QT_VERSION CMake variable to 5.12.8. You can follow further discussion here: