--- /usr/share/cmake/Modules/FindBLAS.cmake 2011-11-23 21:59:33.000000000 -0700 +++ FindBLAS.cmake 2012-01-28 13:31:00.000000000 -0700 @@ -49,8 +49,18 @@ # first, try PkgConfig # find_package(PkgConfig REQUIRED) -pkg_check_modules(BLAS blas) -if(NOT BLAS_FOUND) +pkg_check_modules(PC_BLAS blas) +if(PC_BLAS_FOUND) + foreach(PC_LIB ${PC_BLAS_LIBRARIES}) + find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_BLAS_LIBRARY_DIRS} ) + if (NOT ${PC_LIB}_LIBRARY) + message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_BLAS_LIBRARY_DIRS}") + endif (NOT ${PC_LIB}_LIBRARY) + list(APPEND BLAS_LIBRARIES ${${PC_LIB}_LIBRARY}) + endforeach(PC_LIB) + find_package_handle_standard_args(BLAS DEFAULT_MSG BLAS_LIBRARIES) + mark_as_advanced(BLAS_LIBRARIES) +else(PC_BLAS_FOUND) message(STATUS "No PkgConfig configuration for BLAS found; starting more extensive search.") include(CheckFunctionExists) @@ -637,5 +647,5 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) -endif(NOT BLAS_FOUND) +endif(PC_BLAS_FOUND)