blob: cc81ef12384291d783bd81ad29a27ac07598101b (
plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
########################################################################
# Setup the include and linker paths
########################################################################
INCLUDE_DIRECTORIES(
${GNURADIO_CORE_INCLUDE_DIRS}
${GR_AUDIO_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
LIST(APPEND gr_audio_libs gnuradio-core ${Boost_LIBRARIES})
LIST(APPEND gr_audio_sources gr_audio_registry.cc)
LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/gr-audio.conf)
########################################################################
## ALSA Support
########################################################################
FIND_PACKAGE(ALSA)
IF(ALSA_FOUND)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/alsa ${ALSA_INCLUDE_DIRS})
LIST(APPEND gr_audio_libs ${ALSA_LIBRARIES})
LIST(APPEND gr_audio_sources
${CMAKE_CURRENT_SOURCE_DIR}/alsa/gri_alsa.cc
${CMAKE_CURRENT_SOURCE_DIR}/alsa/audio_alsa_source.cc
${CMAKE_CURRENT_SOURCE_DIR}/alsa/audio_alsa_sink.cc
)
LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/alsa/gr-audio-alsa.conf)
ENDIF(ALSA_FOUND)
########################################################################
## OSS Support
########################################################################
FIND_PACKAGE(OSS)
IF(OSS_FOUND)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/oss ${OSS_INCLUDE_DIRS})
LIST(APPEND gr_audio_sources
${CMAKE_CURRENT_SOURCE_DIR}/oss/audio_oss_source.cc
${CMAKE_CURRENT_SOURCE_DIR}/oss/audio_oss_sink.cc
)
LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/oss/gr-audio-oss.conf)
ENDIF(OSS_FOUND)
########################################################################
## Jack Support
########################################################################
FIND_PACKAGE(Jack)
IF(JACK_FOUND)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/jack ${JACK_INCLUDE_DIRS})
LIST(APPEND gr_audio_libs ${JACK_LIBRARIES})
ADD_DEFINITIONS(${JACK_DEFINITIONS})
LIST(APPEND gr_audio_sources
${CMAKE_CURRENT_SOURCE_DIR}/jack/gri_jack.cc
${CMAKE_CURRENT_SOURCE_DIR}/jack/audio_jack_source.cc
${CMAKE_CURRENT_SOURCE_DIR}/jack/audio_jack_sink.cc
)
LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/jack/gr-audio-jack.conf)
ENDIF(JACK_FOUND)
########################################################################
## OSX Support
########################################################################
INCLUDE(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX(AudioUnit/AudioUnit.h AUDIO_UNIT_H)
CHECK_INCLUDE_FILE_CXX(AudioToolbox/AudioToolbox.h AUDIO_TOOLBOX_H)
IF(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/osx)
LIST(APPEND gr_audio_libs
"-framework AudioUnit"
"-framework CoreAudio"
"-framework AudioToolbox"
)
LIST(APPEND gr_audio_sources
${CMAKE_CURRENT_SOURCE_DIR}/osx/audio_osx_source.cc
${CMAKE_CURRENT_SOURCE_DIR}/osx/audio_osx_sink.cc
)
ENDIF(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H)
########################################################################
## PortAudio Support
########################################################################
FIND_PACKAGE(Portaudio)
IF(PORTAUDIO_FOUND)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/portaudio ${PORTAUDIO_INCLUDE_DIRS})
LIST(APPEND gr_audio_libs ${PORTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${PORTAUDIO_DEFINITIONS})
LIST(APPEND gr_audio_sources
${CMAKE_CURRENT_SOURCE_DIR}/portaudio/gri_portaudio.cc
${CMAKE_CURRENT_SOURCE_DIR}/portaudio/audio_portaudio_source.cc
${CMAKE_CURRENT_SOURCE_DIR}/portaudio/audio_portaudio_sink.cc
)
LIST(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/gr-audio-portaudio.conf)
ENDIF(PORTAUDIO_FOUND)
########################################################################
## Windows Support
########################################################################
IF(WIN32)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/windows)
LIST(APPEND gr_audio_libs winmm.lib)
LIST(APPEND gr_audio_sources
${CMAKE_CURRENT_SOURCE_DIR}/windows/audio_windows_source.cc
${CMAKE_CURRENT_SOURCE_DIR}/windows/audio_windows_sink.cc
)
ENDIF(WIN32)
########################################################################
# Setup library
########################################################################
ADD_LIBRARY(gnuradio-audio SHARED ${gr_audio_sources})
TARGET_LINK_LIBRARIES(gnuradio-audio ${gr_audio_libs})
SET_TARGET_PROPERTIES(gnuradio-audio PROPERTIES DEFINE_SYMBOL "gnuradio_audio_EXPORTS")
SET_TARGET_PROPERTIES(gnuradio-audio PROPERTIES SOVERSION ${LIBVER})
INSTALL(TARGETS gnuradio-audio
LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "audio_runtime" # .so/.dylib file
ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "audio_devel" # .lib file
RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "audio_runtime" # .dll file
)
INSTALL(FILES ${gr_audio_confs} DESTINATION ${GR_PKG_CONF_DIR} COMPONENT "audio_runtime")
|