diff options
-rw-r--r-- | Modules/FindMPI.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index cb52056..97b050e 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -1059,6 +1059,24 @@ macro(_MPI_assemble_libraries LANG) endif() endmacro() +macro(_MPI_assemble_include_dirs LANG) + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() + endif() + if(MPI_${LANG}_INCLUDE_DIRS) + list(REMOVE_DUPLICATES MPI_${LANG}_INCLUDE_DIRS) + endif() +endmacro() + macro(_MPI_split_include_dirs LANG) # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) @@ -1474,6 +1492,9 @@ foreach(LANG IN ITEMS C CXX Fortran) if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") _MPI_split_include_dirs(${LANG}) + _MPI_assemble_include_dirs(${LANG}) + else() + set(MPI_${LANG}_INCLUDE_DIRS "") endif() _MPI_assemble_libraries(${LANG}) |