HAVE_QT is not defined?

Hi, I was trying to build opencv 4.5.5 on Linux Mint 21.3 with the cvv module from opencv-contrib. I used the following to do so

cd /tmp
# Download OpenCV
wget -q https://github.com/opencv/opencv/archive/4.5.5.zip
unzip -q 4.5.5.zip && rm -rf 4.5.5.zip
# Download aruco module (optional)
wget -q https://github.com/opencv/opencv_contrib/archive/refs/tags/4.5.5.zip -O opencv_contrib-4.5.5.zip
unzip -q opencv_contrib-4.5.5.zip && rm -rf opencv_contrib-4.5.5.zip
mkdir -p extra && mv opencv_contrib-4.5.5/modules/aruco && mv opencv_contrib-4.5.5/modules/cvv mv opencv_contrib-4.5.5/modules/xfeatures2d extra
cd opencv-4.5.5
mkdir -p build && cd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DBUILD_DOCS=OFF \
    -DBUILD_EXAMPLES=OFF \
    -DBUILD_JASPER=OFF \
    -DBUILD_OPENEXR=OFF \
    -DBUILD_PERF_TESTS=OFF \
    -DBUILD_TESTS=OFF \
    -DBUILD_PROTOBUF=OFF \
    -DBUILD_opencv_apps=OFF \
    -DBUILD_opencv_dnn=OFF \
    -DBUILD_opencv_ml=OFF \
    -DBUILD_opencv_python_bindings_generator=OFF \
    -DENABLE_CXX11=ON \
    -DENABLE_FAST_MATH=ON \
    -DWITH_EIGEN=ON \
    -DWITH_FFMPEG=ON \
    -DWITH_TBB=ON \
    -DWITH_OPENMP=ON \
    -DOPENCV_EXTRA_MODULES_PATH=/tmp/extra \
    ..
make -j4 && sudo make install

But I kept getting that cvv was unavailable. When I dug into it, I found that in the CMakeLists.txt for cvv it has

if(NOT HAVE_QT OR NOT HAVE_CXX11 OR QT_VERSION_MAJOR LESS 5)
  ocv_module_disable(cvv)
  return()
endif()

When I tried debugging I found that HAVE_QT and HAVE_CX11 and QT_VERSION_MAJOR were all not defined (i.e I added in the if statement message(VAR="${VAR}") for each of these). Why would they not be defined? I installed qt5 using apt. When I remove this check and try to make I get QString not being defined. Do I need to build Qt5 from source for some reason?

Maybe you want to tell OpenCV that you have them? It could be that OpenCV doesn’t search without being told.