summaryrefslogtreecommitdiffstats
path: root/Modules/FindMPI.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-06 15:29:35 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-02-06 15:29:35 (GMT)
commit8e8eeb73ab338fc6a6e2b6af9da3dc6f09cc26d1 (patch)
treef07ef5b3f001c5e4878df00e298894316adcbb3d /Modules/FindMPI.cmake
parenta00cca97b384454f8a7a1f5e665eb1eeaac98001 (diff)
parenta2a73935b22444b158ec5de2916deb02d9f7928b (diff)
downloadCMake-8e8eeb73ab338fc6a6e2b6af9da3dc6f09cc26d1.zip
CMake-8e8eeb73ab338fc6a6e2b6af9da3dc6f09cc26d1.tar.gz
CMake-8e8eeb73ab338fc6a6e2b6af9da3dc6f09cc26d1.tar.bz2
Merge topic 'findmpi-flags-fix'
a2a73935 FindMPI: Remove leading spaces from flags 93f29be2 FindMPI: Reset MPI_INCLUDE_PATH_WORK before use
Diffstat (limited to 'Modules/FindMPI.cmake')
-rw-r--r--Modules/FindMPI.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index e91a6a9..ff2c4de 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -314,6 +314,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()
@@ -323,6 +324,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})
@@ -365,6 +368,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()