From an empty directory, if you configure using:
cmake -DQt5_DIR:PATH=...
There is no need to manually set Slicer_REQUIRED_QT_VERSION
.
If you are using cmake-gui or ccmake, just make sure you are NOT configuring a first time and then setting the Qt5_DIR
variable.
You need to set the Qt5_DIR
variable the first time you configure. That way all default values are properly initialized.