forked from lijiext/lammps
move MPI compilation variable definitions workaround to MPI4WIN.cmake
This commit is contained in:
parent
e5360bb68a
commit
9a5b7141af
|
@ -701,12 +701,6 @@ else()
|
||||||
message(STATUS "Static library flags: ${CMAKE_STATIC_LINKER_FLAGS}")
|
message(STATUS "Static library flags: ${CMAKE_STATIC_LINKER_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
if(BUILD_MPI)
|
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 >>>
|
message(STATUS "<<< MPI flags >>>
|
||||||
-- MPI_defines: ${MPI_CXX_COMPILE_DEFINITIONS}
|
-- MPI_defines: ${MPI_CXX_COMPILE_DEFINITIONS}
|
||||||
-- MPI includes: ${MPI_CXX_INCLUDE_PATH}
|
-- MPI includes: ${MPI_CXX_INCLUDE_PATH}
|
||||||
|
|
|
@ -23,3 +23,8 @@ set_target_properties(MPI::MPI_CXX PROPERTIES
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
INTERFACE_INCLUDE_DIRECTORIES "${SOURCE_DIR}/include"
|
||||||
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
INTERFACE_COMPILE_DEFINITIONS "MPICH_SKIP_MPICXX")
|
||||||
add_dependencies(MPI::MPI_CXX mpi4win_build)
|
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")
|
||||||
|
|
Loading…
Reference in New Issue