Skip to content

Commit b54fa37

Browse files
committed
cmake:lapack: declare outputs so ninja/make can detect dependency
1 parent 5d6b681 commit b54fa37

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

CMakeLists.txt

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.9...3.25)
22

33
project(SCALAPACK VERSION 2.2.1 LANGUAGES C Fortran)
44

@@ -179,6 +179,9 @@ else(LAPACK_FOUND)
179179
ENDIF(USE_OPTIMIZED_LAPACK_BLAS)
180180
if(NOT LAPACK_FOUND)
181181
message(STATUS "--> LAPACK and BLAS were not found. Reference LAPACK and BLAS will be downloaded and installed")
182+
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE STRING "LAPACK library" FORCE)
183+
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas${CMAKE_STATIC_LIBRARY_SUFFIX} CACHE STRING "BLAS library" FORCE)
184+
182185
include(ExternalProject)
183186
ExternalProject_Add(
184187
lapack
@@ -191,15 +194,9 @@ else(LAPACK_FOUND)
191194
-DBUILD_COMPLEX16:BOOL=${BUILD_COMPLEX16}
192195
PREFIX ${SCALAPACK_BINARY_DIR}/dependencies
193196
TLS_VERIFY true
197+
BUILD_BYPRODUCTS ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
194198
)
195-
if (NOT MSVC)
196-
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.a CACHE STRING "LAPACK library" FORCE)
197-
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.a CACHE STRING "BLAS library" FORCE)
198-
else () # MSVC
199-
SET(LAPACK_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/liblapack.lib CACHE STRING "LAPACK library" FORCE)
200-
SET(BLAS_LIBRARIES ${SCALAPACK_BINARY_DIR}/lib/libblas.lib CACHE STRING "BLAS library" FORCE)
201-
endif ()
202-
ENDIF()
199+
ENDIF()
203200
ENDIF()
204201

205202
message(STATUS "BLAS library: ${BLAS_LIBRARIES}")

0 commit comments

Comments
 (0)