-
Notifications
You must be signed in to change notification settings - Fork 211
/
CMakeLists.txt
132 lines (118 loc) · 3.03 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required( VERSION 2.8.8 )
# The "MSVC" flag isn't set until the "project" command
# is called. Let's just check the operating system.
if( NOT WIN32 )
project( multimon-ng C )
else( NOT WIN32 )
# Visual Studio C compiler doesn't support C99 (i.e. stdbool.h);
# so use the Visual Studio C++ compiler instead
project( multimon-ng CXX )
endif( NOT WIN32 )
set( TARGET "${PROJECT_NAME}" )
set( VERSION "1.3.1" )
set( MAJOR "1" )
set( MINOR "3" )
set( PATCH "1" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra" )
if( WIN32 )
add_definitions( "-DWIN32_AUDIO" "-DONLY_RAW" "-DWINDOWS" )
link_libraries( ${TARGET} "-lwinmm" )
set( SOURCES ${SOURCES}
"win32_soundin.c"
)
elseif( UNIX )
find_package( X11 )
if ( X11_FOUND )
option( X11_SUPPORT "Enable X11 display support" ${X11_FOUND} )
mark_as_advanced( X11_SUPPORT )
endif( X11_FOUND )
find_package( PulseAudio )
if ( PULSEAUDIO_FOUND )
option( PULSE_AUDIO_SUPPORT "Enable pulse audio support" ${PULSEAUDIO_FOUND} )
mark_as_advanced( PULSE_AUDIO_SUPPORT )
endif( PULSEAUDIO_FOUND )
# Check if we can use the GCC/llvm __builtin_popcount
include( CheckCSourceCompiles )
check_c_source_compiles(
"int main() { __builtin_popcount(42); return 0; }" USE_BUILTIN_POPCOUNT )
set( INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" )
install( FILES multimon-ng.1 DESTINATION "${INSTALL_MAN_DIR}/man1" )
endif( WIN32 )
if( X11_SUPPORT )
include_directories( ${X11_INCLUDE_DIR} )
link_libraries( ${X11_LIBRARIES} )
set( SOURCES ${SOURCES}
xdisplay.c
demod_display.c
)
else( X11_SUPPORT )
add_definitions( "-DNO_X11" )
endif( X11_SUPPORT )
if( PULSE_AUDIO_SUPPORT )
include_directories( ${PULSEAUDIO_INCLUDE_DIR} )
find_library( PULSE_SIMPLE NAMES pulse-simple REQUIRED )
link_libraries( ${PULSEAUDIO_LIBRARY} ${PULSE_SIMPLE} )
add_definitions( "-DPULSE_AUDIO" )
else( PULSE_AUDIO_SUPPORT )
add_definitions( "-DDUMMY_AUDIO" )
endif( PULSE_AUDIO_SUPPORT )
if( NOT MSVC )
add_definitions( "-std=gnu11" )
endif( NOT MSVC )
add_definitions( "-DMAX_VERBOSE_LEVEL=3" "-DCHARSET_UTF8" )
if ( EXISTS "${multimon-ng_SOURCE_DIR}/BCHCode.c" )
set( SOURCES ${SOURCES}
BCHCode.c )
else()
message(STATUS "Using the BCH decoder stub")
set( SOURCES ${SOURCES}
BCHCode_stub.c )
endif()
set( HEADERS ${HEADERS}
multimon.h
gen.h
filter.h
filter-i386.h
)
set( SOURCES ${SOURCES}
unixinput.c
uart.c
pocsag.c
selcall.c
hdlc.c
demod_zvei1.c
demod_zvei2.c
demod_zvei3.c
demod_pzvei.c
demod_dzvei.c
demod_ccir.c
demod_eia.c
demod_eea.c
demod_ufsk12.c
demod_poc24.c
demod_poc12.c
demod_poc5.c
demod_hapn48.c
demod_fsk96.c
demod_dtmf.c
demod_clipfsk.c
demod_fmsfsk.c
demod_afsk24.c
demod_afsk24_3.c
demod_afsk24_2.c
demod_afsk12.c
demod_flex.c
demod_flex_next.c
costabi.c
costabf.c
clip.c
fms.c
demod_eas.c
demod_morse.c
demod_dumpcsv.c
demod_x10.c
)
add_executable( "${TARGET}" ${SOURCES} ${HEADERS} )
set_property(TARGET "${TARGET}" PROPERTY LINKER_LANGUAGE C)
target_link_libraries( "${TARGET}" m )
install(TARGETS multimon-ng DESTINATION bin)