OS X Big Sur - Temporary files -framework missing argument

I have recently updated to OS X Big Sur and running into an issue with CMake (3.19.4) detecting MPICH. Here is the output in CMakeError.log:

The MPI test test_mpi for C in mode normal failed to compile with the following output:
Change Dir: /Users/allen/Projects/VisIt/git/clean/visit/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_c2172/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_c2172.dir/build.make CMakeFiles/cmTC_c2172.dir/build
Building C object CMakeFiles/cmTC_c2172.dir/test_mpi.c.o
/usr/bin/clang -isystem /Users/allen/Projects/VisIt/Thirdparty/trunk/third_party/mpich/3.4.1/i386-apple-darwin20_clang/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -fexceptions -framework -o CMakeFiles/cmTC_c2172.dir/test_mpi.c.o -c /Users/allen/Projects/VisIt/Thirdparty/trunk/third_party/cmake/3.19.4/i386-apple-darwin20_clang/share/cmake-3.19/Modules/FindMPI/test_mpi.c
clang: error: no such file or directory: ‘CMakeFiles/cmTC_c2172.dir/test_mpi.c.o’
clang: warning: -framework -o: ‘linker’ input unused [-Wunused-command-line-argument]
make[1]: *** [CMakeFiles/cmTC_c2172.dir/test_mpi.c.o] Error 1
make: *** [cmTC_c2172/fast] Error 2


I am using cmake --debug-trycompile so to preserve the temporary directories and files. Specially what would be in cmTC_c2172.dir. But I do not see them. As such, I am not sure if the temporary dir is even created.

However, even if I make the temp dir and do the compile by hand it still does not work because -framework flag expects an argument which is missing and uses the -o flag which is not correct.

As such, there seems to be two possibly inter-related issues. The -framework flag without an argument is of more concern. I am not sure what is causing that and could use some guidance.

Could you please share the code around the try_compile that is being used here? Of particular interest is the call itself and any associated variable settings around it.

Can you please make a small example that reproduces the issue?

Thanks to Ken Moreland he pointed me to this issue:

https://gitlab.kitware.com/cmake/cmake/-/issues/21741

Which is exactly what I am seeing.