diff options
author | Alexey Ozeritsky <aozeritsky@gmail.com> | 2010-12-27 08:42:41 (GMT) |
---|---|---|
committer | Alexey Ozeritsky <aozeritsky@gmail.com> | 2010-12-27 08:42:41 (GMT) |
commit | 51253da8bb193cdac4ac45ac43b250cecc2c0e87 (patch) | |
tree | 3c0112816b8813370dcfdd4a56d8f28e66bbea6e /Modules/FindLAPACK.cmake | |
parent | e64b5daeced6ed29cc9fce252a137a097972b9ce (diff) | |
download | CMake-51253da8bb193cdac4ac45ac43b250cecc2c0e87.zip CMake-51253da8bb193cdac4ac45ac43b250cecc2c0e87.tar.gz CMake-51253da8bb193cdac4ac45ac43b250cecc2c0e87.tar.bz2 |
FindLAPACK works with C/C++ only projects (issue 0009976)
Diffstat (limited to 'Modules/FindLAPACK.cmake')
-rw-r--r-- | Modules/FindLAPACK.cmake | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index f7b7ab5..bf45406 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -37,17 +37,12 @@ # License text for the above reference.) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) -if(NOT _LANGUAGES_ MATCHES Fortran) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "FindLAPACK is Fortran-only so Fortran must be enabled.") - else(LAPACK_FIND_REQUIRED) - message(STATUS "Looking for LAPACK... - NOT found (Fortran not enabled)") - return() - endif(LAPACK_FIND_REQUIRED) -endif(NOT _LANGUAGES_ MATCHES Fortran) - +if (NOT _LANGUAGES_ MATCHES Fortran) +include(CheckFunctionExists) +else (NOT _LANGUAGES_ MATCHES Fortran) include(CheckFortranFunctionExists) +endif (NOT _LANGUAGES_ MATCHES Fortran) + set(LAPACK_FOUND FALSE) set(LAPACK95_FOUND FALSE) @@ -112,7 +107,11 @@ if(_libraries_work) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) endif(UNIX AND BLA_STATIC) # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + if (NOT _LANGUAGES_ MATCHES Fortran) + check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) + else (NOT _LANGUAGES_ MATCHES Fortran) + check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + endif (NOT _LANGUAGES_ MATCHES Fortran) set(CMAKE_REQUIRED_LIBRARIES) mark_as_advanced(${_prefix}${_combined_name}_WORKS) set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) @@ -170,6 +169,7 @@ if(BLAS_FOUND) "" "acml_mp;acml_mv" "" + "" ) endif(NOT LAPACK_LIBRARIES) endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All") |