Merge topic 'FindMPI-lang-reason'

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

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5801
This commit is contained in:
Brad King
2021-02-12 11:53:34 +00:00
committed by Kitware Robot
+3 -1
View File
@@ -1428,7 +1428,9 @@ foreach(LANG IN ITEMS C CXX Fortran)
endif()
else()
set(_MPI_FIND_${LANG} FALSE)
string(APPEND _MPI_FAIL_REASON "MPI component '${LANG}' was requested, but language ${LANG} is not enabled. ")
if(${LANG} IN_LIST MPI_FIND_COMPONENTS)
string(APPEND _MPI_FAIL_REASON "MPI component '${LANG}' was requested, but language ${LANG} is not enabled. ")
endif()
endif()
if(_MPI_FIND_${LANG})
if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )