FindLAPACK works with C/C++ only projects (issue 0009976)

This commit is contained in:
Alexey Ozeritsky 2010-12-27 11:42:41 +03:00
parent e64b5daece
commit 51253da8bb
1 changed files with 11 additions and 11 deletions

View File

@ -37,17 +37,12 @@
# License text for the above reference.) # License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if(NOT _LANGUAGES_ MATCHES Fortran) if (NOT _LANGUAGES_ MATCHES Fortran)
if(LAPACK_FIND_REQUIRED) include(CheckFunctionExists)
message(FATAL_ERROR else (NOT _LANGUAGES_ MATCHES Fortran)
"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)
include(CheckFortranFunctionExists) include(CheckFortranFunctionExists)
endif (NOT _LANGUAGES_ MATCHES Fortran)
set(LAPACK_FOUND FALSE) set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE) set(LAPACK95_FOUND FALSE)
@ -112,7 +107,11 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
endif(UNIX AND BLA_STATIC) endif(UNIX AND BLA_STATIC)
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") # 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) set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS) mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
@ -170,6 +169,7 @@ if(BLAS_FOUND)
"" ""
"acml_mp;acml_mv" "acml_mp;acml_mv"
"" ""
""
) )
endif(NOT LAPACK_LIBRARIES) endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All")