diff options
author | Josh Blum | 2011-07-20 19:04:32 -0700 |
---|---|---|
committer | Josh Blum | 2011-07-20 19:04:32 -0700 |
commit | accb9f2fe8fd8f6a1e114adac5b15304b0e0012d (patch) | |
tree | 09ca98093b2555464265d64fd495fed6102159b4 /gr-audio | |
parent | f914499f4a96fe69ab9cd8dba48f8e3bfc7a54e5 (diff) | |
download | gnuradio-accb9f2fe8fd8f6a1e114adac5b15304b0e0012d.tar.gz gnuradio-accb9f2fe8fd8f6a1e114adac5b15304b0e0012d.tar.bz2 gnuradio-accb9f2fe8fd8f6a1e114adac5b15304b0e0012d.zip |
gr: squashed cmakelists.txt into one commit
Diffstat (limited to 'gr-audio')
-rw-r--r-- | gr-audio/CMakeLists.txt | 101 | ||||
-rw-r--r-- | gr-audio/examples/c++/CMakeLists.txt | 23 | ||||
-rw-r--r-- | gr-audio/examples/python/CMakeLists.txt | 37 | ||||
-rw-r--r-- | gr-audio/grc/CMakeLists.txt | 22 | ||||
-rw-r--r-- | gr-audio/include/CMakeLists.txt | 29 | ||||
-rw-r--r-- | gr-audio/lib/CMakeLists.txt | 159 | ||||
-rw-r--r-- | gr-audio/swig/CMakeLists.txt | 51 |
7 files changed, 422 insertions, 0 deletions
diff --git a/gr-audio/CMakeLists.txt b/gr-audio/CMakeLists.txt new file mode 100644 index 000000000..d44397c02 --- /dev/null +++ b/gr-audio/CMakeLists.txt @@ -0,0 +1,101 @@ +# 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 dependencies +######################################################################## +INCLUDE(GrBoost) + +######################################################################## +# Register component +######################################################################## +INCLUDE(GrComponent) +GR_REGISTER_COMPONENT("gr-audio" ENABLE_GR_AUDIO + Boost_FOUND + ENABLE_GR_CORE_ +) + +GR_SET_GLOBAL(GR_AUDIO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include) + +######################################################################## +# Begin conditional configuration +######################################################################## +IF(ENABLE_GR_AUDIO) + +######################################################################## +# Setup CPack components +######################################################################## +INCLUDE(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_AUDIO_DESCRIPTION "The GNU Radio Audio Blocks") + +CPACK_COMPONENT("audio_runtime" + GROUP "Audio" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("audio_devel" + GROUP "Audio" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("audio_python" + GROUP "Audio" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;audio_runtime" +) + +CPACK_COMPONENT("audio_swig" + GROUP "Audio" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;audio_python;audio_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +ADD_SUBDIRECTORY(include) +ADD_SUBDIRECTORY(lib) +ADD_SUBDIRECTORY(examples/c++) +IF(ENABLE_PYTHON) + ADD_SUBDIRECTORY(swig) + ADD_SUBDIRECTORY(grc) + ADD_SUBDIRECTORY(examples/python) +ENDIF(ENABLE_PYTHON) + +######################################################################## +# Create Pkg Config File +######################################################################## +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-audio.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-audio.pc +@ONLY) + +INSTALL( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-audio.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "audio_devel" +) + +ENDIF(ENABLE_GR_AUDIO) diff --git a/gr-audio/examples/c++/CMakeLists.txt b/gr-audio/examples/c++/CMakeLists.txt new file mode 100644 index 000000000..07b5426de --- /dev/null +++ b/gr-audio/examples/c++/CMakeLists.txt @@ -0,0 +1,23 @@ +# 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. + +INCLUDE_DIRECTORIES(${GR_AUDIO_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${GNURADIO_CORE_INCLUDE_DIRS}) +ADD_EXECUTABLE(dial_tone dial_tone.cc) +TARGET_LINK_LIBRARIES(dial_tone gnuradio-audio) diff --git a/gr-audio/examples/python/CMakeLists.txt b/gr-audio/examples/python/CMakeLists.txt new file mode 100644 index 000000000..c5ca2bba0 --- /dev/null +++ b/gr-audio/examples/python/CMakeLists.txt @@ -0,0 +1,37 @@ +# 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. + +INCLUDE(GrPython) + +GR_PYTHON_INSTALL(PROGRAMS + audio_copy.py + audio_fft.py + audio_play.py + audio_to_file.py + dial_tone.py + dial_tone_daemon.py + dial_tone_wav.py + mono_tone.py + multi_tone.py + noise.py + spectrum_inversion.py + test_resampler.py + DESTINATION ${GR_PKG_DATA_DIR}/examples/audio + COMPONENT "audio_python" +) diff --git a/gr-audio/grc/CMakeLists.txt b/gr-audio/grc/CMakeLists.txt new file mode 100644 index 000000000..067761fed --- /dev/null +++ b/gr-audio/grc/CMakeLists.txt @@ -0,0 +1,22 @@ +# 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. + +######################################################################## +FILE(GLOB xml_files "*.xml") +INSTALL(FILES ${xml_files} DESTINATION ${GRC_BLOCKS_DIR} COMPONENT "audio_python") diff --git a/gr-audio/include/CMakeLists.txt b/gr-audio/include/CMakeLists.txt new file mode 100644 index 000000000..9b7ed46c9 --- /dev/null +++ b/gr-audio/include/CMakeLists.txt @@ -0,0 +1,29 @@ +# 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. + +######################################################################## +# Install header files +######################################################################## +INSTALL(FILES + gr_audio_api.h + gr_audio_source.h + gr_audio_sink.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "audio_devel" +) diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt new file mode 100644 index 000000000..f5cafb7b3 --- /dev/null +++ b/gr-audio/lib/CMakeLists.txt @@ -0,0 +1,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") diff --git a/gr-audio/swig/CMakeLists.txt b/gr-audio/swig/CMakeLists.txt new file mode 100644 index 000000000..a113239e9 --- /dev/null +++ b/gr-audio/swig/CMakeLists.txt @@ -0,0 +1,51 @@ +# 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 swig generation +######################################################################## +INCLUDE(GrPython) +INCLUDE(GrSwig) + +SET(GR_SWIG_INCLUDE_DIRS + ${GR_AUDIO_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} +) + +SET(GR_SWIG_LIBRARIES gnuradio-audio) + +GR_SWIG_MAKE(audio_swig audio_swig.i) + +GR_SWIG_INSTALL( + TARGETS audio_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/audio + COMPONENT "audio_python" +) + +INSTALL( + FILES audio_swig.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "audio_swig" +) + +GR_PYTHON_INSTALL( + FILES __init__.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/audio + COMPONENT "audio_python" +) |