diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2022-04-26 20:00:14 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2022-04-26 20:16:31 (GMT) |
commit | c9c2e040aaf96540c22ba8cfd56fab87b4378bc5 (patch) | |
tree | f2667457d1cd19b7a11c28cca180ea4d8b07e789 /Modules/FindMPI.cmake | |
parent | c6ead9be834f779ae5d45841043431944d00e379 (diff) | |
download | CMake-c9c2e040aaf96540c22ba8cfd56fab87b4378bc5.zip CMake-c9c2e040aaf96540c22ba8cfd56fab87b4378bc5.tar.gz CMake-c9c2e040aaf96540c22ba8cfd56fab87b4378bc5.tar.bz2 |
FindMPI: Don't check for variables named the same as the languages
We want to see if a language is inside `MPI_FIND_COMPONENTS` not if
the variables `C`/`CXX` is set to a positive value.
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r-- | Modules/FindMPI.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index c974d33..6b60deb 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1452,21 +1452,21 @@ foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) if(NOT MPI_FIND_COMPONENTS) set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} IN_LIST MPI_FIND_COMPONENTS) + elseif( LANG IN_LIST MPI_FIND_COMPONENTS) set(_MPI_FIND_${LANG} TRUE) - elseif( ${LANG} STREQUAL CXX AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) + elseif( "${LANG}" STREQUAL "CXX" AND NOT MPI_CXX_SKIP_MPICXX AND MPICXX IN_LIST MPI_FIND_COMPONENTS ) set(_MPI_FIND_${LANG} TRUE) else() set(_MPI_FIND_${LANG} FALSE) endif() else() set(_MPI_FIND_${LANG} FALSE) - if(${LANG} IN_LIST MPI_FIND_COMPONENTS) + 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 ) + if( "${LANG}" STREQUAL "CXX" AND NOT MPICXX IN_LIST MPI_FIND_COMPONENTS ) option(MPI_CXX_SKIP_MPICXX "If true, the MPI-2 C++ bindings are disabled using definitions." FALSE) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() |