Skip to content

FindMPI: Fix reason for a non-enabled non-requested language

Axel Huebl requested to merge ax3l/cmake:fix-MPIreasonFortranInCXX into master

In pure C/CXX projects, when doing an optional search for C/CXX MPI APIs, I keep getting a reason appended of the form:

-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS)
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS)
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND)
    Reason given by package: MPI component 'Fortran' was requested, but language Fortran is not enabled.

The additional reason text is confusing, since I did not request Fortran. It is now only added if the component was truly requested.

Cc: @ChrisTX
Backport: release
Topic-rename: FindMPI-lang-reason

Edited by Brad King

Merge request reports