cmake: mark MPI::MPI_CXX global

This commit is contained in:
Christoph Junghans 2020-03-31 19:59:33 -06:00
parent 099880e91b
commit b645800537
1 changed files with 2 additions and 1 deletions

View File

@ -188,9 +188,10 @@ if(BUILD_MPI)
include(MPI4WIN)
target_link_libraries(lammps PUBLIC LAMMPS::MPI)
else()
set(MPI_CXX_SKIP_MPICXX ON)
find_package(MPI REQUIRED)
target_compile_definitions(lammps PRIVATE -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1)
target_link_libraries(lammps PUBLIC MPI::MPI_CXX)
set_target_properties(MPI::MPI_CXX PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(LAMMPS::MPI ALIAS MPI::MPI_CXX)
option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)
if(LAMMPS_LONGLONG_TO_LONG)