File: build-static-library-with-cmake

package info (click to toggle)
liquid-dsp 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,216 kB
  • sloc: ansic: 115,859; sh: 3,513; makefile: 1,350; python: 274; asm: 11
file content (61 lines) | stat: -rw-r--r-- 2,079 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Description: Extend CMakeLists.txt to build and install static library
Author: Andreas Bombe <aeb@debian.org>
Forwarded: not-needed
Last-Update: 2025-03-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -345,6 +345,30 @@
     $<TARGET_OBJECTS:utility>
     $<TARGET_OBJECTS:vector>)
 
+add_library(${LIBNAME}-static STATIC
+    src/libliquid.c
+    $<TARGET_OBJECTS:agc>
+    $<TARGET_OBJECTS:audio>
+    $<TARGET_OBJECTS:buffer>
+    $<TARGET_OBJECTS:channel>
+    $<TARGET_OBJECTS:dotprod>
+    $<TARGET_OBJECTS:equalization>
+    $<TARGET_OBJECTS:fec>
+    $<TARGET_OBJECTS:fft>
+    $<TARGET_OBJECTS:filter>
+    $<TARGET_OBJECTS:framing>
+    $<TARGET_OBJECTS:math>
+    $<TARGET_OBJECTS:matrix>
+    $<TARGET_OBJECTS:modem>
+    $<TARGET_OBJECTS:multichannel>
+    $<TARGET_OBJECTS:nco>
+    $<TARGET_OBJECTS:optim>
+    $<TARGET_OBJECTS:quantization>
+    $<TARGET_OBJECTS:random>
+    $<TARGET_OBJECTS:sequence>
+    $<TARGET_OBJECTS:utility>
+    $<TARGET_OBJECTS:vector>)
+
 target_include_directories(${LIBNAME} PRIVATE ${INCLUDE})
 #target_sources(${LIBNAME} PUBLIC FILE_SET HEADERS FILES include/liquid.h)
 
@@ -378,11 +402,13 @@
 target_link_libraries(${LIBNAME} c m)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION ${LIQUID_VERSION} SOVERSION 1)
+set_target_properties(${LIBNAME}-static PROPERTIES OUTPUT_NAME ${LIBNAME})
 
 # see: https://cmake.org/cmake/help/latest/command/install.html#examples
 # TODO: uninstall?
 install(TARGETS
           ${LIBNAME}
+          ${LIBNAME}-static
         RUNTIME           # Following options apply to runtime artifacts.
           COMPONENT Runtime
         LIBRARY           # Following options apply to library artifacts.
@@ -390,7 +416,6 @@
           NAMELINK_COMPONENT Development
         ARCHIVE           # Following options apply to archive artifacts.
           COMPONENT Development
-          DESTINATION lib/static
         #FILE_SET HEADERS  # Following options apply to file set HEADERS.
           #COMPONENT Development
         )