$NetBSD: patch-CBLAS_src_CMakeLists.txt,v 1.4 2021/05/13 07:52:05 thor Exp $ - Support combined build of shared and static libraries. - Link CBLAS with Fortran compiler to fix build on NetBSD. --- CBLAS/src/CMakeLists.txt.orig 2021-03-25 18:25:15.000000000 +0000 +++ CBLAS/src/CMakeLists.txt @@ -116,7 +116,6 @@ list(REMOVE_DUPLICATES SOURCES) add_library(${CBLASLIB} ${SOURCES}) set_target_properties( ${CBLASLIB} PROPERTIES - LINKER_LANGUAGE C VERSION ${LAPACK_VERSION} SOVERSION ${LAPACK_MAJOR_VERSION} ) @@ -129,3 +128,18 @@ target_include_directories(${CBLASLIB} P ) target_link_libraries(${CBLASLIB} PRIVATE ${BLAS_LIBRARIES}) lapack_install_library(${CBLASLIB}) + +if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) + add_library(${CBLASLIB}_static STATIC ${SOURCES}) + set_target_properties( + ${CBLASLIB}_static PROPERTIES + OUTPUT_NAME ${CBLASLIB} + ) + target_include_directories(${CBLASLIB}_static PUBLIC + $ + $ + ) + target_link_libraries(${CBLASLIB}_static PRIVATE ${BLAS_LIBRARIES}) + lapack_install_library(${CBLASLIB}_static) +endif() +