${MPI_C_INCLUDE_DIRS} not working when the compiler is also set to mpicc

I have a CMake Project where I specify to find the include dirs using

target_include_directories (project PUBLIC ${MPI_C_INCLUDE_DIRS})

The following message results in an empty output if I set -DCMAKE_C_COMPILER=/path/to/mpicc

message(STATUS "MPI Include directories : ${MPI_C_INCLUDE_DIRS}")

but results in the correct directory if the compiler is set to gcc
-DCMAKE_C_COMPILER=/path/to/gcc

Any advice will be really helpful. The behavior is reproduced on cmake 3.22 on windows subsystem for linux and also on fedora.

Another interesting thing I just noted is that when using mpicc, the cmake config command outputs
-- Include directory /home/user/.local/MPI/include does not exist

but infact it does exists indeed and is found when the compiler is set to gcc.