FindMPI: Do not cache MPI_CXX_SKIP_MPICXX option
MPI_CXX_SKIP_MPICXX didn't behave as expected due to being cached.
Current FindMPI contains
set(MPI_CXX_SKIP_MPICXX FALSE CACHE BOOL "If true, the MPI-2 C++ bindings are disabled using definitions.")
When the app CMakeLists does
set(MPI_CXX_SKIP_MPICXX TRUE)
find_package(MPI COMPONENTS CXX)
The first cmake invocation changes MPI_CXX_SKIP_MPICXX to false at the line setting cache. But subsequent cmake invocation skips the cache setting and keeps current value true. These are all undesired behavior. I have not found a need to keep this variable cached. So deleting these set lines seems the best option. After the change, control at the app level is respected.
Topic-rename: FindMPI-no-cache-MPI_CXX_SKIP_MPICXX
Edited by Brad King