move MPI compilation variable definitions workaround to MPI4WIN.cmake

This commit is contained in:
Axel Kohlmeyer 2020-04-26 00:14:27 -04:00
parent e5360bb68a
commit 9a5b7141af
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
2 changed files with 5 additions and 6 deletions

View File

@ -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}

View File

@ -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")