IF (NOT LAPACKE_FOUND)
  # Check LAPACKE installation
  FIND_PATH(LAPACKE_FOUND_INCLUDE_PATH lapacke.h
    HINTS ${LAPACKE_INSTALL_PATH}/include
    NO_DEFAULT_PATH
  )
  FIND_LIBRARY(LAPACKE_FOUND_LIBRARY NAMES lapacke
    HINTS ${LAPACKE_INSTALL_PATH}/lib ${LAPACKE_INSTALL_PATH}/lib64
    NO_DEFAULT_PATH
  )
  FIND_LIBRARY(LAPACK_FOUND_LIBRARY NAMES lapack
    HINTS ${LAPACKE_INSTALL_PATH}/lib ${LAPACKE_INSTALL_PATH}/lib64
    NO_DEFAULT_PATH
  )

  IF (LAPACKE_FOUND_INCLUDE_PATH AND LAPACKE_FOUND_LIBRARY AND LAPACK_FOUND_LIBRARY)
    ADD_LIBRARY(lapacke INTERFACE)
    SET_TARGET_PROPERTIES(lapacke PROPERTIES
#      IMPORTED_LOCATION ${LAPACKE_FOUND_LIBRARY}
      INTERFACE_INCLUDE_DIRECTORIES ${LAPACKE_FOUND_INCLUDE_PATH}
      INTERFACE_COMPILE_OPTIONS "-I${LAPACKE_FOUND_INCLUDE_PATH}"
      INTERFACE_LINK_LIBRARIES ${LAPACKE_FOUND_LIBRARY} 
    )
    INSTALL(TARGETS lapacke
      EXPORT tines-targets
      LIBRARY DESTINATION "${TINES_INSTALL_LIB_PATH}"
      ARCHIVE DESTINATION "${TINES_INSTALL_LIB_PATH}"
    )
    ADD_LIBRARY(lapack INTERFACE)
    SET_TARGET_PROPERTIES(lapack PROPERTIES
#      IMPORTED_LOCATION ${LAPACK_FOUND_LIBRARY}
      INTERFACE_LINK_LIBRARIES ${LAPACK_FOUND_LIBRARY}
    )
    INSTALL(TARGETS lapack
      EXPORT tines-targets
      LIBRARY DESTINATION "${TINES_INSTALL_LIB_PATH}"
      ARCHIVE DESTINATION "${TINES_INSTALL_LIB_PATH}"
    )

    SET(LAPACKE_FOUND ON)
    MESSAGE("-- LAPACKE is found at ${LAPACKE_FOUND_LIBRARY}")
    MESSAGE("-- LAPACK  is found at ${LAPACK_FOUND_LIBRARY}")
  ELSE()
     MESSAGE(FATAL_ERROR "-- LAPACKE is not found at ${LAPACKE_INSTALL_PATH}")
  ENDIF()
ENDIF()