diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2015-01-12 14:21:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-14 15:19:06 (GMT) |
commit | 68857ccd823088caf240318f2a7b39522fc383da (patch) | |
tree | ff9a2f3af0e0e50e55c634354914dd15627b57c5 /Modules | |
parent | 4aa9c64511adb6e3aa1b686d07f8cbdf92dedbab (diff) | |
download | CMake-68857ccd823088caf240318f2a7b39522fc383da.zip CMake-68857ccd823088caf240318f2a7b39522fc383da.tar.gz CMake-68857ccd823088caf240318f2a7b39522fc383da.tar.bz2 |
FindMPI: handle trailing slash from $MSMPI_BIN
When installing, MSMPI puts a trailing backslash in the MSMPI_BIN
environment variable. This causes trouble when concatenating in CMake
since the list separator is now escaped and no longer a list separator
due to the trailing backslash. Instead, use file(TO_CMAKE_PATH) to make
the path CMake-friendly.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMPI.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 9192054..545b077 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -175,7 +175,9 @@ set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) set(_MPI_PREFIX_PATH) if(WIN32) # MSMPI - list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_BIN}") + file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. + list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") + unset(msmpi_bin_path) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime # MPICH |