find_package does not find existing package

The environment that CMake GUI sees might not be the same as the one you see at a Unix shell prompt. It depends how you started CMake GUI. The same comment applies to Qt Creator too, although it does at least allow you to see and customise the environment in each kit.

Delete the CMakeCache.txt file in your build directory, and then run CMake again with CMAKE_PREFIX_PATH set to /opt/qt5.15. You should not need to set any ..._DIR variables. If you have a properly installed Qt in that directory, setting CMAKE_PREFIX_PATH alone should result in the following call finding Qt successfully:

find_package(Qt5 REQUIRED COMPONENTS Gui Widgets Core)

If that fails, then show us the directory structure under /opt/qt5.15. In particular, there should be a lib/cmake directory, or something similar to that.

Don’t bother setting CMAKE_PROJECT_INCLUDE_BEFORE to anything. Qt Creator does various things for its own internal purposes or to support workflows that are probably not of interest to you right now. When you’re running CMake directly and just want to get the project configured, you don’t need much more than just CMAKE_PREFIX_PATH.

You can definitely use Qt without Qt Creator. CI jobs run headless and manage to configure and build Qt projects just fine. We just need to work out what’s happening with your environment and perhaps something you’re setting incorrectly.