[Cmake-commits] [cmake-commits] dgregor committed FindMPI.cmake 1.20 1.21
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Jul 18 08:17:26 EDT 2008
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv6191
Modified Files:
FindMPI.cmake
Log Message:
ENH: Use the HINTS feature of find_library to find the right libraries for
MPI, and act a bit more intelligently when MPI cannot be found.
Index: FindMPI.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindMPI.cmake,v
retrieving revision 1.20
retrieving revision 1.21
diff -C 2 -d -r1.20 -r1.21
*** FindMPI.cmake 22 Apr 2008 13:54:23 -0000 1.20
--- FindMPI.cmake 18 Jul 2008 12:17:23 -0000 1.21
***************
*** 211,219 ****
string(REGEX REPLACE "^-l" "" LIB ${LIB})
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
! find_library(MPI_LIB ${LIB} PATHS ${MPI_LINK_PATH})
if (MPI_LIB)
list(APPEND MPI_LIBRARIES ${MPI_LIB})
else (MPI_LIB)
! status(ERROR "Unable to find MPI library ${LIB}")
endif (MPI_LIB)
endforeach(LIB)
--- 211,219 ----
string(REGEX REPLACE "^-l" "" LIB ${LIB})
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
! find_library(MPI_LIB ${LIB} HINTS ${MPI_LINK_PATH})
if (MPI_LIB)
list(APPEND MPI_LIBRARIES ${MPI_LIB})
else (MPI_LIB)
! message(SEND_ERROR "Unable to find MPI library ${LIB}")
endif (MPI_LIB)
endforeach(LIB)
***************
*** 223,232 ****
# MPI_EXTRA_LIBRARY.
list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
! if (MPI_NUMLIBS GREATER 0)
list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK)
set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE)
! else (MPI_NUMLIBS GREATER 0)
! set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE STRING "MPI library to link against" FORCE)
! endif (MPI_NUMLIBS GREATER 0)
if (MPI_NUMLIBS GREATER 1)
set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES})
--- 223,233 ----
# MPI_EXTRA_LIBRARY.
list(LENGTH MPI_LIBRARIES MPI_NUMLIBS)
! list(LENGTH MPI_LIBNAMES MPI_NUMLIBS_EXPECTED)
! if (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
list(GET MPI_LIBRARIES 0 MPI_LIBRARY_WORK)
set(MPI_LIBRARY ${MPI_LIBRARY_WORK} CACHE FILEPATH "MPI library to link against" FORCE)
! else (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
! set(MPI_LIBRARY "MPI_LIBRARY-NOTFOUND" CACHE FILEPATH "MPI library to link against" FORCE)
! endif (MPI_NUMLIBS EQUAL MPI_NUMLIBS_EXPECTED)
if (MPI_NUMLIBS GREATER 1)
set(MPI_EXTRA_LIBRARY_WORK ${MPI_LIBRARIES})
More information about the Cmake-commits
mailing list