Commit 2c807b75 authored by Kitware Robot's avatar Kitware Robot Committed by Brad King
Browse files

FindBLAS: Re-indent module source code to use normal conventions

parent 39cfdd65
...@@ -96,23 +96,23 @@ if(BLA_PREFER_PKGCONFIG) ...@@ -96,23 +96,23 @@ if(BLA_PREFER_PKGCONFIG)
endif() endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
# This macro checks for the existence of the combination of fortran libraries # This macro checks for the existence of the combination of fortran libraries
# given by _list. If the combination is found, this macro checks (using the # given by _list. If the combination is found, this macro checks (using the
# Check_Fortran_Function_Exists macro) whether can link against that library # Check_Fortran_Function_Exists macro) whether can link against that library
# combination using the name of a routine given by _name using the linker # combination using the name of a routine given by _name using the linker
# flags given by _flags. If the combination of libraries is found and passes # flags given by _flags. If the combination of libraries is found and passes
# the link test, LIBRARIES is set to the list of complete library paths that # the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE. # have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that # N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro. # are generated internally and marked advanced by this macro.
set(_libdir ${ARGN}) set(_libdir ${ARGN})
set(_libraries_work TRUE) set(_libraries_work TRUE)
set(${LIBRARIES}) set(${LIBRARIES})
set(_combined_name) set(_combined_name)
if (NOT _libdir) if (NOT _libdir)
if (WIN32) if (WIN32)
set(_libdir ENV LIB) set(_libdir ENV LIB)
elseif (APPLE) elseif (APPLE)
...@@ -120,9 +120,9 @@ if (NOT _libdir) ...@@ -120,9 +120,9 @@ if (NOT _libdir)
else () else ()
set(_libdir ENV LD_LIBRARY_PATH) set(_libdir ENV LD_LIBRARY_PATH)
endif () endif ()
endif () endif ()
foreach(_library ${_list}) foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library}) set(_combined_name ${_combined_name}_${_library})
if(_libraries_work) if(_libraries_work)
...@@ -149,11 +149,11 @@ foreach(_library ${_list}) ...@@ -149,11 +149,11 @@ foreach(_library ${_list})
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif() endif()
endforeach() endforeach()
if(_libraries_work) if(_libraries_work)
# Test this combination of libraries. # Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
if (CMAKE_Fortran_COMPILER_LOADED) if (CMAKE_Fortran_COMPILER_LOADED)
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
else() else()
...@@ -162,11 +162,11 @@ if(_libraries_work) ...@@ -162,11 +162,11 @@ if(_libraries_work)
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})
endif() endif()
if(NOT _libraries_work) if(NOT _libraries_work)
set(${LIBRARIES} FALSE) set(${LIBRARIES} FALSE)
endif() endif()
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro() endmacro()
set(BLAS_LINKER_FLAGS) set(BLAS_LINKER_FLAGS)
...@@ -399,11 +399,11 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -399,11 +399,11 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" ) "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
endif() endif()
endif() endif()
elseif(BLAS_${BLA_VENDOR}_LIB_DIRS) elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS}) set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS})
endif() endif()
if( BLA_VENDOR STREQUAL "ACML_MP" ) if( BLA_VENDOR STREQUAL "ACML_MP" )
foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS}) foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS})
check_fortran_libraries ( check_fortran_libraries (
BLAS_LIBRARIES BLAS_LIBRARIES
...@@ -415,7 +415,7 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -415,7 +415,7 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
break() break()
endif() endif()
endforeach() endforeach()
elseif( BLA_VENDOR STREQUAL "ACML_GPU" ) elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS}) foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS})
check_fortran_libraries ( check_fortran_libraries (
BLAS_LIBRARIES BLAS_LIBRARIES
...@@ -427,7 +427,7 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -427,7 +427,7 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
break() break()
endif() endif()
endforeach() endforeach()
else() else()
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} ) foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
check_fortran_libraries ( check_fortran_libraries (
BLAS_LIBRARIES BLAS_LIBRARIES
...@@ -439,10 +439,10 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -439,10 +439,10 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
break() break()
endif() endif()
endforeach() endforeach()
endif() endif()
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both # Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES BLAS_LIBRARIES
BLAS BLAS
...@@ -451,8 +451,8 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -451,8 +451,8 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv" "acml;acml_mv"
"" ""
) )
endif() endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES BLAS_LIBRARIES
BLAS BLAS
...@@ -461,8 +461,8 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -461,8 +461,8 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"acml_mp;acml_mv" "acml_mp;acml_mv"
"" ""
) )
endif() endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES BLAS_LIBRARIES
BLAS BLAS
...@@ -471,12 +471,12 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") ...@@ -471,12 +471,12 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv;CALBLAS" "acml;acml_mv;CALBLAS"
"" ""
) )
endif() endif()
endif () # ACML endif () # ACML
# Apple BLAS library? # Apple BLAS library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
check_fortran_libraries( check_fortran_libraries(
BLAS_LIBRARIES BLAS_LIBRARIES
BLAS BLAS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment