list(REMOVE_ITEM ARGS "BLAS")
list(REMOVE_ITEM ARGS "blas")
list(REMOVE_ITEM ARGS "Blas")
list(REMOVE_ITEM ARGS "NO_MODULE")
list(REMOVE_ITEM ARGS "CONFIG")
list(REMOVE_ITEM ARGS "MODULE")
if(NOT BLAS_LIBRARY OR BLAS_LIBRARIES OR OpenBLAS_LIBRARY OR OpenBLAS_LIBRARIES OR BLAS_LIB OR BLAS_LIBS)
  include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
  include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)

  _find_package(OpenBLAS CONFIG ${ARGS})

  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
  _find_package(Threads)

  get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
  set(BLAS_INCLUDE_DIR ${_loc})
  get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_IMPLIB_RELEASE)
  if(NOT _loc)
    get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY LOCATION_RELEASE)
  endif()
  set(BLAS_LIBRARY_RELEASE ${_loc})
  get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY IMPORTED_IMPLIB_DEBUG)
  if(NOT _loc)
    get_property(_loc TARGET OpenBLAS::OpenBLAS PROPERTY LOCATION_DEBUG)
  endif()
  set(BLAS_LIBRARY_DEBUG ${_loc})
  list(APPEND BLAS_LIBRARY_RELEASE Threads::Threads)
  list(APPEND BLAS_LIBRARY_DEBUG Threads::Threads)
  select_library_configurations(BLAS)

  set(BLAS_LIBRARY "${BLAS_LIBRARY}" CACHE STRING "" FORCE)
  set(BLAS_LIBRARIES "${BLAS_LIBRARY}" CACHE STRING "" FORCE)
  set(OpenBLAS_LIBRARY "${BLAS_LIBRARY}" CACHE STRING "" FORCE)
  set(OpenBLAS_LIBRARIES "${BLAS_LIBRARY}" CACHE STRING "" FORCE)
  set(BLAS_LIB "${BLAS_LIBRARY}" CACHE STRING "" FORCE)
  set(BLAS_LIBS "${BLAS_LIBRARY}" CACHE STRING "" FORCE)

  set(BLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}" CACHE STRING "" FORCE)
  set(BLAS_INCLUDE_DIRS "${BLAS_INCLUDE_DIR}" CACHE STRING "" FORCE)
  set(OpenBLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}" CACHE STRING "" FORCE)
  set(OpenBLAS_INCLUDE_DIRS "${BLAS_INCLUDE_DIR}" CACHE STRING "" FORCE)
  set(BLAS_INC "${BLAS_INCLUDE_DIR}" CACHE STRING "" FORCE)

  find_package_handle_standard_args(BLAS DEFAULT_MSG BLAS_LIBRARY BLAS_INCLUDE_DIR)
  mark_as_advanced(BLAS_INCLUDE_DIR BLAS_LIBRARY)
  find_package_handle_standard_args(OpenBLAS DEFAULT_MSG OpenBLAS_LIBRARY OpenBLAS_INCLUDE_DIR)
  mark_as_advanced(OpenBLAS_INCLUDE_DIR OpenBLAS_LIBRARY)
endif()
