From 8c1b77e48f2984f7a11434959e37d08514521595 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Sun, 9 Sep 2018 07:04:09 -0600 Subject: [PATCH 1/2] cmake: workaround for cmake bug#18349 --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f384f423bd..f84095b5f48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,7 +286,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_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}) From c2639fa9494dfd2c73f8d45aedd478ac7014a391 Mon Sep 17 00:00:00 2001 From: Christoph Junghans Date: Mon, 10 Sep 2018 05:28:59 -0600 Subject: [PATCH 2/2] cmake: MPI_COMPILE_FLAGS -> MPI_CXX_COMPILE_FLAGS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f84095b5f48..08a7b5507a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,7 +287,7 @@ endif(WITH_VALGRIND_INSTRUMENTATION) find_package(MPI REQUIRED) # Workaround for https://gitlab.kitware.com/cmake/cmake/issues/18349 -foreach(_MPI_FLAG ${MPI_COMPILE_FLAGS}) +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}")