فهرست منبع

Merge topic 'FindMPI-lang-reason' into release-3.20

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

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5801
Brad King 5 سال پیش
والد
کامیت
a86cd9cb3c
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      Modules/FindMPI.cmake

+ 3 - 1
Modules/FindMPI.cmake

@@ -1428,7 +1428,9 @@ foreach(LANG IN ITEMS C CXX Fortran)
     endif()
     endif()
   else()
   else()
     set(_MPI_FIND_${LANG} FALSE)
     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()
   endif()
   if(_MPI_FIND_${LANG})
   if(_MPI_FIND_${LANG})
     if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )
     if( ${LANG} STREQUAL CXX AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS )