$NetBSD: patch-TESTING_MATGEN_CMakeLists.txt,v 1.3 2021/05/12 14:32:51 thor Exp $

Support combined build of shared and static libraries.

--- TESTING/MATGEN/CMakeLists.txt.orig	2021-03-25 18:25:15.000000000 +0000
+++ TESTING/MATGEN/CMakeLists.txt
@@ -57,3 +57,12 @@ set_target_properties(
 
 target_link_libraries(${TMGLIB} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
 lapack_install_library(${TMGLIB})
+if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
+  add_library(${TMGLIB}_static STATIC ${SOURCES})
+  set_target_properties(
+    ${TMGLIB}_static PROPERTIES
+    OUTPUT_NAME tmglib
+  )
+  target_link_libraries(${TMGLIB}_static ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES})
+  lapack_install_library(${TMGLIB}_static)
+endif()
