From 93f29be2316f51f1d27fb543f92911be5b9cec9e Mon Sep 17 00:00:00 2001 From: Christian Pfeiffer Date: Wed, 1 Feb 2017 18:45:13 +0100 Subject: FindMPI: Reset MPI_INCLUDE_PATH_WORK before use --- Modules/FindMPI.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 842acef..9cc7cab 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -322,6 +322,8 @@ function (interrogate_mpi_compiler lang try_libs) # Extract include paths from compile command line string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}") + set(MPI_INCLUDE_PATH_WORK) + foreach(IPATH ${MPI_ALL_INCLUDE_PATHS}) string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH}) string(REPLACE "//" "/" IPATH ${IPATH}) -- cgit v0.12 From a2a73935b22444b158ec5de2916deb02d9f7928b Mon Sep 17 00:00:00 2001 From: Christian Pfeiffer Date: Thu, 2 Feb 2017 11:31:22 +0100 Subject: FindMPI: Remove leading spaces from flags --- Modules/FindMPI.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 9cc7cab..dd700e3 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -313,6 +313,7 @@ function (interrogate_mpi_compiler lang try_libs) set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_COMPILE_FLAGS_WORK) string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}") else() @@ -364,6 +365,7 @@ function (interrogate_mpi_compiler lang try_libs) string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}") set(MPI_LINK_FLAGS_WORK) foreach(FLAG ${MPI_ALL_LINK_FLAGS}) + string(REGEX REPLACE "^ " "" FLAG ${FLAG}) if (MPI_LINK_FLAGS_WORK) string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}") else() -- cgit v0.12