Check out https://wiki.qt.io/Qt6_Add-on_src_package_build_using_Conan_package_manager . The easiest setup currently is to install qt3d into the Qt SDK by running
Do you have cmake installed and if so which version ?
That said, /opt is usually not user writable so you should do an out of source build from somewhere you can like your home folder (doing it as root is a bad idea).