Skip to content

Commit

Permalink
Merge pull request espressomd#2244 from junghans/cmake_mpi_workaround
Browse files Browse the repository at this point in the history
cmake: workaround for cmake bug#18349
  • Loading branch information
KaiSzuttor authored and RudolfWeeber committed Oct 15, 2018
1 parent e90d9b8 commit 1f7df4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ endif(WITH_VALGRIND_INSTRUMENTATION)
#######################################################################

find_package(MPI REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_COMPILE_FLAGS}")
# Workaround for https://gitlab.kitware.com/cmake/cmake/issues/18349
foreach(_MPI_FLAG ${MPI_CXX_COMPILE_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_MPI_FLAG}")
endforeach()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_LINK_FLAGS}")
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
list(APPEND LIBRARIES ${MPI_LIBRARIES})
Expand Down

0 comments on commit 1f7df4a

Please sign in to comment.