FindMPI: Fix various legacy problems
This MR fixes a number of bugs stemming from legacy variable handling, partially introduced by !893 (merged).
-
MPI_COMPILE_OPTIONS
andMPI_COMPILE_DEFINITIONS
legacy hints were not passed correctly. - Legacy variables could be parsed after they were set by
FindMPI
cause erroneous hinting on subsequent runs. - In the case of the compiler supporting MPI implicitly:
- not all consumption variables would be correctly reset.
-
MPI_<LANG>_HEADER_DIR
would be set unintentionally. -
MPI_<LANG>_LIB_NAMES
appeared in cache despite being ignored. - on subsequent passes,
MPI_<LANG>_COMPILER
could be corrupted.
- the C-to-CXX copy logic would take place even if MPI_SKIP_GUESSING was turned on
- if only some language compilers were given, inconsistent search behavior could be observed
Issue: #17538 (closed)