FindMPI: Fix parsing of mpicc -Wl,-L link flags (#9093)

Commit d84cbd0f (FindMPI: Parse mpicc flags more carefully, 2010-06-24)
broke parsing of '-L' flags appearing after '-Wl,' by expecting a
preceding space.  Update the regular expression to allow '-Wl,-L' too.
This commit is contained in:
Brad King 2010-06-29 10:59:52 -04:00
parent 8460059a72
commit 96c7cb26e9
1 changed files with 2 additions and 2 deletions

View File

@ -230,10 +230,10 @@ elseif (MPI_COMPILE_CMDLINE)
endif (NOT MPI_INCLUDE_PATH_WORK)
# Extract linker paths from the link command line
string(REGEX MATCHALL "(^| )-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
string(REGEX MATCHALL "(^| |-Wl,)-L([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_PATH)
foreach(LPATH ${MPI_ALL_LINK_PATHS})
string(REGEX REPLACE "^ ?-L" "" LPATH ${LPATH})
string(REGEX REPLACE "^(| |-Wl,)-L" "" LPATH ${LPATH})
string(REGEX REPLACE "//" "/" LPATH ${LPATH})
list(APPEND MPI_LINK_PATH ${LPATH})
endforeach(LPATH)