Using VS Generator without a vswhere findable VS install

Following situation:

I have a “portable” (meaning it wasn’t installed) VS and the environment is already set up similar to vcvars env (Meaning it works without problems for Ninja & MSBuild).

I would like to run CMake configure with -G “Visual Studio 2022”. I tried providing CMAKE_GENERATOR_INSTANCE etc but CMake complains/errors that the version in that path is not findable with vswhere. Is there a way to force CMake to just generate the project without doing further VS related tests and just trust the user that it will work (maybe setting some extra vars)? I mean in the end it CMake doesn’t need to know all the Details about the VS installation.

Maybe I just need to use 3.31 instead of 3.30.1 since https://gitlab.kitware.com/cmake/cmake/-/commit/e801d2b2438e0841ec28f466b5b2dfa29b65bc62 might be the solution?

Ok the problem is that https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/cmVSSetupHelper.cxx#L67
looks for a specific file and I only had /VC/Auxiliary/Build/Microsoft.VCToolsVersion.v143.default.txt. A bit annoying that I actually had to build cmake from source and attach a debugger to figure that one out. Would be better if CMake would inform the user about the failure to load that file.