aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindLAPACK.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/FindLAPACK.cmake')
-rw-r--r--cmake/FindLAPACK.cmake27
1 files changed, 14 insertions, 13 deletions
diff --git a/cmake/FindLAPACK.cmake b/cmake/FindLAPACK.cmake
index 2fcae2199..3fd738807 100644
--- a/cmake/FindLAPACK.cmake
+++ b/cmake/FindLAPACK.cmake
@@ -26,6 +26,7 @@
include(CheckFunctionExists)
+include(CMakeFindDependencyMacro)
# 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
@@ -75,8 +76,8 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_found ${${_prefix}_${_library}_LIBRARY})
- endif(_libraries_found)
- endforeach(_library ${_list})
+ endif()
+ endforeach()
if(_libraries_found)
set(_libraries_found ${${LIBRARIES}})
endif()
@@ -88,7 +89,7 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b
set(${LIBRARIES} ${_libraries_found})
# Some C++ linkers require the f2c library to link with Fortran libraries.
# I do not know which ones, thus I just add the f2c library if it is available.
- find_package( F2C QUIET )
+ find_dependency( F2C QUIET )
if ( F2C_FOUND )
set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS})
set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES})
@@ -103,7 +104,7 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b
set(CMAKE_REQUIRED_LIBRARIES "")
mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS})
- endif(_libraries_found AND NOT _libraries_work)
+ endif()
# If not found, test this combination of libraries with a C interface.
# A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard.
@@ -117,7 +118,7 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b
set(CMAKE_REQUIRED_LIBRARIES "")
mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS})
- endif(_libraries_found AND NOT _libraries_work)
+ endif()
# on failure
if(NOT _libraries_work)
@@ -126,7 +127,7 @@ macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _b
endif()
#message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}")
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
-endmacro(check_lapack_libraries)
+endmacro()
#
@@ -135,9 +136,9 @@ endmacro(check_lapack_libraries)
# LAPACK requires BLAS
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
- find_package(BLAS)
+ find_dependency(BLAS)
else()
- find_package(BLAS REQUIRED)
+ find_dependency(BLAS REQUIRED)
endif()
if (NOT BLAS_FOUND)
@@ -216,7 +217,7 @@ else()
"${BLAS_LIBRARIES}"
"${CGAL_TAUCS_LIBRARIES_DIR} ENV LAPACK_LIB_DIR"
)
- endif ( NOT LAPACK_LIBRARIES )
+ endif ()
# Generic LAPACK library?
# This configuration *must* be the last try as this library is notably slow.
@@ -242,14 +243,14 @@ else()
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_FOUND)
message(STATUS "A library with LAPACK API found.")
- else(LAPACK_FOUND)
+ else()
if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location.")
else()
message(STATUS "A library with LAPACK API not found. Please specify library location.")
endif()
- endif(LAPACK_FOUND)
- endif(NOT LAPACK_FIND_QUIETLY)
+ endif()
+ endif()
# Add variables to cache
set( LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}"
@@ -270,4 +271,4 @@ else()
#message("DEBUG: LAPACK_LIBRARIES_DIR = ${LAPACK_LIBRARIES_DIR}")
#message("DEBUG: LAPACK_FOUND = ${LAPACK_FOUND}")
-endif(NOT BLAS_FOUND)
+endif()