/[gentoo-x86]/dev-util/cmake/files/cmake-2.8.7-FindBLAS.patch
Gentoo

Contents of /dev-util/cmake/files/cmake-2.8.7-FindBLAS.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Mar 8 04:45:58 2012 UTC (2 years, 4 months ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Respect pkg-config library path in FindBLAS, bug 399755

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 diff -ruN cmake-2.8.7.orig/Modules/FindBLAS.cmake cmake-2.8.7/Modules/FindBLAS.cmake
2 --- cmake-2.8.7.orig/Modules/FindBLAS.cmake 2011-12-30 17:49:56.000000000 +0100
3 +++ cmake-2.8.7/Modules/FindBLAS.cmake 2012-03-08 05:38:47.000000000 +0100
4 @@ -1,3 +1,9 @@
5 +#
6 +# Version modified for Gentoo Linux
7 +# If a valid PkgConfig configuration for blas is found, this overrides and cancels
8 +# all further checks.
9 +#
10 +
11 # - Find BLAS library
12 # This module finds an installed fortran library that implements the BLAS
13 # linear-algebra interface (see http://www.netlib.org/blas/).
14 @@ -39,6 +45,24 @@
15 # (To distribute this file outside of CMake, substitute the full
16 # License text for the above reference.)
17
18 +#
19 +# first, try PkgConfig
20 +#
21 +find_package(PkgConfig REQUIRED)
22 +pkg_check_modules(PC_BLAS blas)
23 +if(PC_BLAS_FOUND)
24 + foreach(PC_LIB ${PC_BLAS_LIBRARIES})
25 + find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_BLAS_LIBRARY_DIRS} )
26 + if (NOT ${PC_LIB}_LIBRARY)
27 + message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_BLAS_LIBRARY_DIRS}")
28 + endif (NOT ${PC_LIB}_LIBRARY)
29 + list(APPEND BLAS_LIBRARIES ${${PC_LIB}_LIBRARY})
30 + endforeach(PC_LIB)
31 + find_package_handle_standard_args(BLAS DEFAULT_MSG BLAS_LIBRARIES)
32 + mark_as_advanced(BLAS_LIBRARIES)
33 +else(PC_BLAS_FOUND)
34 +message(STATUS "No PkgConfig configuration for BLAS found; starting more extensive search.")
35 +
36 include(CheckFunctionExists)
37 include(CheckFortranFunctionExists)
38
39 @@ -622,3 +646,6 @@
40 endif(BLA_F95)
41
42 set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
43 +
44 +endif(PC_BLAS_FOUND)
45 +

  ViewVC Help
Powered by ViewVC 1.1.20