File: use-fec-lib-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 (52 lines) | stat: -rw-r--r-- 1,609 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
Description: Detect and link with FEC library in cmake build
Author: Andreas Bombe <aeb@debian.org>
Forwarded: not-needed
Last-Update: 2025-03-15 <YYYY-MM-DD, last update of the meta-information, optional>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 # cmake build file for liquid-dsp
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.18)
 
 # run custom command to parse version number from include/liquid.h
 execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/version.sh
@@ -46,6 +46,8 @@
 # check for hardware acceleration
 include(cmake/FindSIMD.cmake)
 pkg_check_modules(FFTW3 IMPORTED_TARGET fftw3f REQUIRED)
+find_library(FEC_LIBRARY fec REQUIRED)
+check_include_file(fec.h HAVE_FEC_H)
 
 # global flags
 if (MSVC)
@@ -60,6 +62,10 @@
     set(HAVE_FFTW3_H 1)
 endif()
 
+if (HAVE_FEC_H)
+    set(HAVE_LIBFEC 1)
+endif()
+
 include (CheckTypeSize)
 check_type_size(int SIZEOF_INT LANGUAGE C)
 
@@ -404,7 +410,7 @@
     target_link_options(${LIBNAME} PRIVATE -coverage)
 endif(COVERAGE)
 
-target_link_libraries(${LIBNAME} c m PkgConfig::FFTW3)
+target_link_libraries(${LIBNAME} c m PkgConfig::FFTW3 ${FEC_LIBRARY})
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION ${LIQUID_VERSION} SOVERSION 1)
 set_target_properties(${LIBNAME}-static PROPERTIES OUTPUT_NAME ${LIBNAME})
--- a/cmake/config.h.cmake
+++ b/cmake/config.h.cmake
@@ -6,3 +6,5 @@
 #cmakedefine HAVE_LIBC
 #cmakedefine SIZEOF_INT @SIZEOF_INT@
 #cmakedefine HAVE_FFTW3_H 1
+#cmakedefine HAVE_FEC_H
+#cmakedefine HAVE_LIBFEC