Commit cb05cbc1 authored by Robert Maynard's avatar Robert Maynard

Properly find MPI and setup DIY when CMake >= 3.10

parent 4a096150
......@@ -203,6 +203,9 @@ check_type_size("long long" VTKm_SIZE_LONG_LONG BUILTIN_TYPES_ONLY)
if(VTKm_ENABLE_MPI)
# This `if` is temporary and will be removed once `diy` supports building
# without MPI.
if (NOT MPI_C_FOUND)
find_package(MPI ${VTKm_FIND_PACKAGE_QUIETLY})
endif()
add_subdirectory(diy)
endif()
add_subdirectory(vtkm)
......
......@@ -33,8 +33,11 @@ target_include_directories(diy INTERFACE
$<INSTALL_INTERFACE:${VTKm_INSTALL_INCLUDE_DIR}>)
# presently, this dependency is required. Make it optional in the future.
# CMake 3.10 FindMPI removed MPI_<>_INCLUDE_PATH and replaced them with the
# MPI_<>_INCLUDE_DIRS so the FindMPI conforms to CMake find module requirements
set(arg)
foreach(apath IN LISTS MPI_C_INCLUDE_PATH MPI_CXX_INCLUDE_PATH)
foreach(apath IN LISTS MPI_C_INCLUDE_PATH MPI_CXX_INCLUDE_PATH
MPI_C_INCLUDE_DIRS MPI_CXX_INCLUDE_DIRS)
list(APPEND arg $<BUILD_INTERFACE:${apath}>)
endforeach()
target_include_directories(diy INTERFACE ${arg})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment