diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 628f68f6ea..9f29220d4f 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -701,12 +701,6 @@ else() message(STATUS "Static library flags: ${CMAKE_STATIC_LINKER_FLAGS}") endif() if(BUILD_MPI) - # get MPI compile settings from MPI4WIN imported target when cross-compiling - if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING) - get_target_property(MPI_CXX_INCLUDE_PATH MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES) - get_target_property(MPI_CXX_COMPILE_DEFINITIONS MPI::MPI_CXX INTERFACE_COMPILE_DEFINITIONS) - get_target_property(MPI_CXX_LIBRARIES MPI::MPI_CXX IMPORTED_LOCATION) - endif() message(STATUS "<<< MPI flags >>> -- MPI_defines: ${MPI_CXX_COMPILE_DEFINITIONS} -- MPI includes: ${MPI_CXX_INCLUDE_PATH} diff --git a/cmake/Modules/MPI4WIN.cmake b/cmake/Modules/MPI4WIN.cmake index 19d2d2a13e..035c6a22f3 100644 --- a/cmake/Modules/MPI4WIN.cmake +++ b/cmake/Modules/MPI4WIN.cmake @@ -23,3 +23,8 @@ set_target_properties(MPI::MPI_CXX PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include" INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") add_dependencies(MPI::MPI_CXX mpi4win_build) + +# set variables for status reporting at the end of CMake run +set(MPI_CXX_INCLUDE_PATH "${SOURCE_DIR}/include") +set(MPI_CXX_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX") +set(MPI_CXX_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")