First, thanks for the pointer. However after looking through these CMakeSettings references, it did not look like what I wanted. This seems to be more about having VS run cmake with the correct settings. However, I do not want to have VS run cmake. Cmake is only run from within my bash script, which is in the MinGW environment. It also does other things beside running cmake.
If I were to only use CMake directly without bash script helpers, then maybe this would be the right approach, though it looks a bit like doing everything twice to me. If I wanted to e.g. also compile outside VS from say windows shell. Why write the settings again in a CMakeSettings.json specifically for VS, when I already have all settings outside VS? On the other hand, if I were to do the settings only in VS, then compiling outside VS would not be easily possible .. which I very much want to avoid. Imho code should be independent from IDE tools, including the compilation process. Having to deal with possibly different build systems is already enough of a nightmare :)
Second, I'm sorry - it seems something in my question is not correct, as today the command did not run correctly in Powershell anymore. I'm not sure what is different now, as I made sure it ran while typing the post .. maybe I forgot to hit save somewhere or similar ..
But this helped me identify the issue, which was to simply set CMAKE_GENERATOR to "MSYS Makefiles". It seems cmake will automatically check for MSVC first if VS is installed, which is probably the reason why I did not need to set this before I installed VS. Then again it somehow worked without setting it yesterday, so this is only a guess .. For now everything works.