summaryrefslogtreecommitdiffstats
path: root/Modules/FindBLAS.cmake
diff options
context:
space:
mode:
authorAlin Elena <alinm.elena@gmail.com>2008-07-21 17:40:31 (GMT)
committerAlin Elena <alinm.elena@gmail.com>2008-07-21 17:40:31 (GMT)
commit834dd533ed7d73d8e97aea64bb276b4b86e71eea (patch)
tree942f7514868e72178c54b3f6d84e8685c9274021 /Modules/FindBLAS.cmake
parentff63bb1b4441e8ef2eb2eb3cfa65cc5125e0b462 (diff)
downloadCMake-834dd533ed7d73d8e97aea64bb276b4b86e71eea.zip
CMake-834dd533ed7d73d8e97aea64bb276b4b86e71eea.tar.gz
CMake-834dd533ed7d73d8e97aea64bb276b4b86e71eea.tar.bz2
ENH: checks if Fortran is enbaled. If not an error message is produced.
Diffstat (limited to 'Modules/FindBLAS.cmake')
-rw-r--r--Modules/FindBLAS.cmake13
1 files changed, 8 insertions, 5 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 58d0967..8aa425f 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -1,4 +1,5 @@
-# - Find BLAS library
+# - Find a Fortran BLAS library
+# N.B. Fortran only. This module cannot be used to find a C BLAS library.
# This module finds an installed fortran library that implements the BLAS
# linear-algebra interface (see http://www.netlib.org/blas/).
# The list of libraries searched for is taken
@@ -15,6 +16,11 @@
# BLAS95_LIBRARIES - uncached list of libraries (using full path name) # to link against to use BLAS95 interface
#
+get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
+if(NOT _LANGUAGES_ MATCHES Fortran)
+ message(FATAL_ERROR "FindBLAS is Fortran-only so Fortran must be enabled.")
+endif(NOT _LANGUAGES_ MATCHES Fortran)
+
include(CheckFortranFunctionExists)
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list)
@@ -65,10 +71,7 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list)
# Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
- get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
- if(_LANGUAGES_ MATCHES Fortran)
- check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
- endif(_LANGUAGES_ MATCHES Fortran)
+ check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})