summaryrefslogtreecommitdiff
path: root/math/lapack/patches/patch-TESTING_MATGEN_CMakeLists.txt
blob: 9a5a553122a0ba4291d632ae9c0136bb20d6f48d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$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()