forked from TLeconte/acarsdec
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
63 lines (54 loc) · 1.6 KB
/
CMakeLists.txt
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
62
63
cmake_minimum_required (VERSION 3.2)
project (acarsdec C)
add_compile_options(-Ofast -march=native )
add_executable(acarsdec acars.c acarsdec.c cJSON.c label.c msk.c output.c )
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LIBACARS libacars-2>=2.0.0)
if(LIBACARS_FOUND)
message ( STATUS "Using libacars")
add_definitions(-DHAVE_LIBACARS )
target_link_libraries(acarsdec ${LIBACARS_LIBRARIES})
target_include_directories(acarsdec PUBLIC ${LIBACARS_INCLUDE_DIRS})
link_directories(${LIBACARS_LIBRARY_DIRS})
else()
message ( STATUS "Not using libacars")
endif()
endif()
option(rtl "Compiling for rtl sdr" )
if(rtl)
find_library(LIBRTL rtlsdr)
if(NOT LIBRTL)
message (FATAL_ERROR "librtlsdr path not found")
endif()
add_definitions(-DWITH_RTL )
target_sources( acarsdec PRIVATE rtl.c)
target_link_libraries( acarsdec ${LIBRTL})
endif()
option(airspy "Compiling for airspy sdr" )
if(airspy)
find_library(LIBAIR airspy)
if(NOT LIBAIR)
message ( FATAL_ERROR "libairspy path not found")
endif()
add_definitions(-DWITH_AIR )
target_sources( acarsdec PRIVATE air.c)
target_link_libraries( acarsdec ${LIBAIR})
endif()
option(sdrplay "Compiling for sdrplay sdr" )
if(sdrplay)
find_library(LIBPLAY mirsdrapi-rsp)
if(NOT LIBPLAY)
message ( FATAL_ERROR "libmirsdrapi-rsp path not found")
endif()
add_definitions(-DWITH_SDRPLAY )
target_sources( acarsdec PRIVATE sdrplay.c)
target_link_libraries( acarsdec ${LIBPLAY})
endif()
if(NOT rtl AND NOT airspy AND NOT sdrplay)
message ("No sdr option set ! are you sure ?")
endif()
target_link_libraries( acarsdec pthread m )
install(TARGETS acarsdec
RUNTIME DESTINATION bin
)