IF(NOT MPI_MPI_H MATCHES "-NOTFOUND" AND NOT DEFINED MPI_VERSION)
FILE(STRINGS "${MPI_MPI_H}" MPI_VERSION_MAJOR_STRING
REGEX "#define.*MPI_VERSION")
- STRING(REGEX REPLACE "^.*MPI_VERSION.*([0-9]+).*" "\\1"
+ STRING(REGEX REPLACE "^.*MPI_VERSION[ ]+([0-9]+).*" "\\1"
MPI_VERSION_MAJOR "${MPI_VERSION_MAJOR_STRING}"
)
FILE(STRINGS ${MPI_MPI_H} MPI_VERSION_MINOR_STRING
REGEX "#define.*MPI_SUBVERSION")
- STRING(REGEX REPLACE "^.*MPI_SUBVERSION.*([0-9]+).*" "\\1"
+ STRING(REGEX REPLACE "^.*MPI_SUBVERSION[ ]+([0-9]+).*" "\\1"
MPI_VERSION_MINOR "${MPI_VERSION_MINOR_STRING}"
)
SET(MPI_VERSION "${MPI_VERSION_MAJOR}.${MPI_VERSION_MINOR}")
# OMPI specific version number:
FILE(STRINGS ${MPI_MPI_H} OMPI_VERSION_MAJOR_STRING
REGEX "#define.*OMPI_MAJOR_VERSION")
- STRING(REGEX REPLACE "^.*OMPI_MAJOR_VERSION.*([0-9]+).*" "\\1"
+ STRING(REGEX REPLACE "^.*OMPI_MAJOR_VERSION[ ]+([0-9]+).*" "\\1"
OMPI_VERSION_MAJOR "${OMPI_VERSION_MAJOR_STRING}"
)
FILE(STRINGS ${MPI_MPI_H} OMPI_VERSION_MINOR_STRING
REGEX "#define.*OMPI_MINOR_VERSION")
- STRING(REGEX REPLACE "^.*OMPI_MINOR_VERSION.*([0-9]+).*" "\\1"
+ STRING(REGEX REPLACE "^.*OMPI_MINOR_VERSION[ ]+([0-9]+).*" "\\1"
OMPI_VERSION_MINOR "${OMPI_VERSION_MINOR_STRING}"
)
FILE(STRINGS ${MPI_MPI_H} OMPI_VERSION_RELEASE_STRING
REGEX "#define.*OMPI_RELEASE_VERSION")
- STRING(REGEX REPLACE "^.*OMPI_RELEASE_VERSION.*([0-9]+).*" "\\1"
+ STRING(REGEX REPLACE "^.*OMPI_RELEASE_VERSION[ ]+([0-9]+).*" "\\1"
OMPI_VERSION_SUBMINOR "${OMPI_VERSION_RELEASE_STRING}"
)
SET(OMPI_VERSION