From a02a8b39586f20ba5b9b72b290f6976ae18780c6 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Thu, 14 Mar 2019 21:18:03 -0500 Subject: [PATCH] updated GLUT and LAPACKE CMake files to follow the new _ROOT standard --- cmake/FindGLUT.cmake | 7 +++---- cmake/FindLAPACKE.cmake | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 cmake/FindLAPACKE.cmake diff --git a/cmake/FindGLUT.cmake b/cmake/FindGLUT.cmake index 25b2cbb..1a59a5d 100644 --- a/cmake/FindGLUT.cmake +++ b/cmake/FindGLUT.cmake @@ -46,20 +46,19 @@ if (WIN32) find_path( GLUT_INCLUDE_DIR NAMES GL/glut.h - PATHS $ENV{GLUT_ROOT_PATH}/include ) + PATHS $ENV{GLUT_ROOT}/include) if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) find_library( GLUT_glut_LIBRARY NAMES freeglut PATHS - $ENV{GLUT_ROOT_PATH}/lib/x64 + $ENV{GLUT_ROOT}/lib/x64 NO_DEFAULT_PATH ) else( CMAKE_SIZEOF_VOID_P EQUAL 8 ) find_library( GLUT_glut_LIBRARY NAMES glut glut32 freeglut PATHS - ${OPENGL_LIBRARY_DIR} - $ENV{GLUT_ROOT_PATH}/lib + $ENV{GLUT_ROOT}/lib ) endif( CMAKE_SIZEOF_VOID_P EQUAL 8 ) diff --git a/cmake/FindLAPACKE.cmake b/cmake/FindLAPACKE.cmake new file mode 100644 index 0000000..96dacf2 --- /dev/null +++ b/cmake/FindLAPACKE.cmake @@ -0,0 +1,43 @@ +# - Try to find LAPACKE +# +# Once done this will define +# LAPACKE_FOUND - System has LAPACKE +# LAPACKE_INCLUDE_DIRS - The LAPACKE include directories +# LAPACKE_LIBRARIES - The libraries needed to use LAPACKE +# LAPACKE_DEFINITIONS - Compiler switches required for using LAPACKE +# +# Usually, LAPACKE requires LAPACK and the BLAS. This module does +# not enforce anything about that. + +find_path(LAPACKE_INCLUDE_DIR + NAMES lapacke.h + PATHS $ENV{LAPACK_ROOT} $ENV{LAPACK_PATH} ${INCLUDE_INSTALL_DIR} + PATHS ENV INCLUDE) + +find_library(LAPACKE_LIBRARY liblapacke lapacke + PATHS $ENV{LAPACK_ROOT} $ENV{LAPACK_PATH} ${LIB_INSTALL_DIR} + PATHS ENV LIBRARY_PATH + PATHS ENV LD_LIBRARY_PATH) + +if(MSVC) + find_library(LAPACK_LIBRARY liblapack lapack + PATHS $ENV{LAPACK_ROOT} $ENV{LAPACK_PATH} ${LIB_INSTALL_DIR} + PATHS ENV LIBRARY_PATH + PATHS ENV LD_LIBRARY_PATH) + + find_library(BLAS_LIBRARY libblas blas + PATHS $ENV{LAPACK_ROOT} $ENV{LAPACK_PATH} ${LIB_INSTALL_DIR} + PATHS ENV LIBRARY_PATH + PATHS ENV LD_LIBRARY_PATH) + +else() + find_library(LAPACK REQUIRED) + find_library(BLAS REQUIRED) +endif() +set(LAPACKE_LIBRARIES ${LAPACKE_LIBRARY} ${LAPACK_LIBRARY} ${BLAS_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LAPACKE DEFAULT_MSG + LAPACKE_INCLUDE_DIR + LAPACKE_LIBRARIES) +mark_as_advanced(LAPACKE_INCLUDE_DIR LAPACKE_LIBRARIES) -- libgit2 0.21.4