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)
endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
# 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
# Check_Fortran_Function_Exists macro) whether can link against that library
# 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
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libdir ${ARGN})
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
if (NOT _libdir)
# 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
# Check_Fortran_Function_Exists macro) whether can link against that library
# 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
# the link test, LIBRARIES is set to the list of complete library paths that
# have been found. Otherwise, LIBRARIES is set to FALSE.
# N.B. _prefix is the prefix applied to the names of all cached variables that
# are generated internally and marked advanced by this macro.
set(_libdir ${ARGN})
set(_libraries_work TRUE)
set(${LIBRARIES})
set(_combined_name)
if (NOT _libdir)
if (WIN32)
set(_libdir ENV LIB)
elseif (APPLE)
......@@ -120,9 +120,9 @@ if (NOT _libdir)
else ()
set(_libdir ENV LD_LIBRARY_PATH)
endif ()
endif ()
endif ()
foreach(_library ${_list})
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
if(_libraries_work)
......@@ -149,11 +149,11 @@ foreach(_library ${_list})
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
endif()
endforeach()
if(_libraries_work)
endforeach()
if(_libraries_work)
# Test this combination of libraries.
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)
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
else()
......@@ -162,11 +162,11 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
endif()
if(NOT _libraries_work)
endif()
if(NOT _libraries_work)
set(${LIBRARIES} FALSE)
endif()
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endif()
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro()
set(BLAS_LINKER_FLAGS)
......@@ -399,11 +399,11 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" )
endif()
endif()
elseif(BLAS_${BLA_VENDOR}_LIB_DIRS)
elseif(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})
check_fortran_libraries (
BLAS_LIBRARIES
......@@ -415,7 +415,7 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
break()
endif()
endforeach()
elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
elseif( BLA_VENDOR STREQUAL "ACML_GPU" )
foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS})
check_fortran_libraries (
BLAS_LIBRARIES
......@@ -427,7 +427,7 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
break()
endif()
endforeach()
else()
else()
foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} )
check_fortran_libraries (
BLAS_LIBRARIES
......@@ -439,10 +439,10 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
break()
endif()
endforeach()
endif()
endif()
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
if(NOT BLAS_LIBRARIES)
# Either acml or acml_mp should be in LD_LIBRARY_PATH but not both
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
......@@ -451,8 +451,8 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv"
""
)
endif()
if(NOT BLAS_LIBRARIES)
endif()
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
......@@ -461,8 +461,8 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"acml_mp;acml_mv"
""
)
endif()
if(NOT BLAS_LIBRARIES)
endif()
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
......@@ -471,12 +471,12 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv;CALBLAS"
""
)
endif()
endif()
endif () # ACML
# Apple BLAS library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
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