title: CMake can not find LAPACK library on windows
body: <p>I'm trying to build a C++ project using <strong>CMake</strong> which includes <strong>LAPACK library</strong> on a <strong>win32</strong> system.</p>
  
  <p>Following the documentary <a href="https://icl.cs.utk.edu/lapack-for-windows/lapack/#libraries_mingw" rel="nofollow noreferrer">LAPACK for windows</a>,</p>
  
  <p>I installed MinGW 32 bits and added "C:\MinGW\bin" in the path, 
  then put downloaded pre-built libraries: libblas.lib, libblas.dll, liblapack.lib, liblapack.dll in the path
  "\projectRoot\3rdparty\LAPACK"</p>
  
  <p>The structure of folders is as below:</p>
  
  <pre><code>\projectRoot
      \CMakeLists.txt
      \3rdparty
           \LAPACK
               libblas.lib
               ...
  </code></pre>
  
  <p>in the CMakeLists file, I added </p>
  
  <pre><code>set(LAPACK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/LAPACK")
  find_package(LAPACK REQUIRED)
  </code></pre>
  
  <p>but got error:</p>
  
  <pre><code>CMake Error at C:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
    Could NOT find BLAS (missing: BLAS_LIBRARIES)
  Call Stack (most recent call first):
    C:/Program Files/CMake/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
    C:/Program Files/CMake/share/cmake-3.16/Modules/FindBLAS.cmake:810 (find_package_handle_standard_args)
    C:/Program Files/CMake/share/cmake-3.16/Modules/FindLAPACK.cmake:197 (find_package)
    CMakeLists.txt:17 (find_package)
  </code></pre>
  
  <p>and before the error, there's something that CMake couldn't find</p>
  
  <pre><code>Looking for sgemm_
  Looking for sgemm_ - not found
  Looking for pthread.h
  Looking for pthread.h - not found
  Found Threads: TRUE  
  </code></pre>
  
  <p>I can't figure out what's the cause of the problem. </p>
  
  <p>Thank you in advance if you could share your experience.       </p>