Skip to content

Commit a973de6

Browse files
committed
cmake: workaround find_package bug that overrides forced cache BLAS_LIBRARIES
the symptom was that CMake needed to be configured twice if BLAS wasn't found.
1 parent 4517933 commit a973de6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ else(LAPACK_FOUND)
180180
find_package(LAPACK)
181181
ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
182182
if(NOT LAPACK_FOUND)
183+
unset(BLAS_LIBRARIES) # override "FALSE" variable that leaks from find_package(LAPACK) and Cache by defintion doesn't override
183184
message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
184185
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/liblapack${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE STRING "LAPACK library" FORCE)
185186
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/libblas${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE STRING "BLAS library" FORCE)

0 commit comments

Comments
 (0)