summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd')
-rw-r--r--gr-uhd/CMakeLists.txt107
-rw-r--r--gr-uhd/apps/CMakeLists.txt84
-rw-r--r--gr-uhd/examples/CMakeLists.txt67
-rw-r--r--gr-uhd/grc/CMakeLists.txt46
-rw-r--r--gr-uhd/include/CMakeLists.txt30
-rw-r--r--gr-uhd/lib/CMakeLists.txt58
-rw-r--r--gr-uhd/swig/CMakeLists.txt53
7 files changed, 445 insertions, 0 deletions
diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt
new file mode 100644
index 000000000..8eacc6105
--- /dev/null
+++ b/gr-uhd/CMakeLists.txt
@@ -0,0 +1,107 @@
+# 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)
+
+find_package(UHD)
+
+########################################################################
+# Register component
+########################################################################
+include(GrComponent)
+GR_REGISTER_COMPONENT("gr-uhd" ENABLE_GR_UHD
+ Boost_FOUND
+ UHD_FOUND
+ ENABLE_GR_CORE
+)
+
+GR_SET_GLOBAL(GR_UHD_INCLUDE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${UHD_INCLUDE_DIRS}
+)
+
+########################################################################
+# Begin conditional configuration
+########################################################################
+if(ENABLE_GR_UHD)
+
+########################################################################
+# Setup CPack components
+########################################################################
+include(GrPackage)
+CPACK_SET(CPACK_COMPONENT_GROUP_UHD_DESCRIPTION "GNU Radio UHD Blocks")
+
+CPACK_COMPONENT("uhd_runtime"
+ GROUP "UHD"
+ DISPLAY_NAME "Runtime"
+ DESCRIPTION "Runtime"
+ DEPENDS "core_runtime"
+)
+
+CPACK_COMPONENT("uhd_devel"
+ GROUP "UHD"
+ DISPLAY_NAME "Development"
+ DESCRIPTION "C++ headers, package config, import libraries"
+ DEPENDS "core_devel"
+)
+
+CPACK_COMPONENT("uhd_python"
+ GROUP "UHD"
+ DISPLAY_NAME "Python"
+ DESCRIPTION "Python modules for runtime; GRC xml files"
+ DEPENDS "core_python;uhd_runtime"
+)
+
+CPACK_COMPONENT("uhd_swig"
+ GROUP "UHD"
+ DISPLAY_NAME "SWIG"
+ DESCRIPTION "SWIG development .i files"
+ DEPENDS "core_swig;uhd_python;uhd_devel"
+)
+
+########################################################################
+# Add subdirectories
+########################################################################
+add_subdirectory(include)
+add_subdirectory(lib)
+add_subdirectory(examples)
+if(ENABLE_PYTHON)
+ add_subdirectory(swig)
+ add_subdirectory(grc)
+ add_subdirectory(apps)
+endif(ENABLE_PYTHON)
+
+########################################################################
+# Create Pkg Config File
+########################################################################
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-uhd.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-uhd.pc
+@ONLY)
+
+install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-uhd.pc
+ DESTINATION ${GR_LIBRARY_DIR}/pkgconfig
+ COMPONENT "uhd_devel"
+)
+
+endif(ENABLE_GR_UHD)
diff --git a/gr-uhd/apps/CMakeLists.txt b/gr-uhd/apps/CMakeLists.txt
new file mode 100644
index 000000000..36bee13e0
--- /dev/null
+++ b/gr-uhd/apps/CMakeLists.txt
@@ -0,0 +1,84 @@
+# 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)
+
+########################################################################
+# Install some uhd apps
+########################################################################
+GR_PYTHON_INSTALL(
+ PROGRAMS
+ uhd_fft.py
+ uhd_rx_cfile.py
+ uhd_siggen.py
+ uhd_siggen_gui.py
+ uhd_rx_nogui.py
+ DESTINATION ${GR_RUNTIME_DIR}
+ COMPONENT "uhd_python"
+)
+
+########################################################################
+# Install hf radio apps
+########################################################################
+install(
+ FILES
+ hf_radio/hfir.sci
+ hf_radio/radio.xml
+ hf_radio/README.TXT
+ hf_radio/ssb_taps
+ DESTINATION ${GR_PKG_DATA_DIR}/examples/hf_radio
+ COMPONENT "uhd_python"
+)
+
+GR_PYTHON_INSTALL(
+ FILES
+ hf_radio/input.py
+ hf_radio/output.py
+ hf_radio/ssbagc.py
+ hf_radio/ssbdemod.py
+ hf_radio/startup.py
+ DESTINATION ${GR_PKG_DATA_DIR}/examples/hf_radio
+ COMPONENT "uhd_python"
+)
+
+GR_PYTHON_INSTALL(
+ PROGRAMS
+ hf_radio/radio.py
+ hf_radio/ui.py
+ DESTINATION ${GR_PKG_DATA_DIR}/examples/hf_radio
+ COMPONENT "uhd_python"
+)
+
+########################################################################
+# Install hf explorer
+########################################################################
+install(
+ FILES
+ hf_explorer/README
+ hf_explorer/hfx_help
+ DESTINATION ${GR_PKG_DATA_DIR}/examples/hf_explorer
+ COMPONENT "uhd_python"
+)
+
+GR_PYTHON_INSTALL(
+ PROGRAMS
+ hf_explorer/hfx.py
+ DESTINATION ${GR_PKG_DATA_DIR}/examples/hf_explorer
+ COMPONENT "uhd_python"
+)
diff --git a/gr-uhd/examples/CMakeLists.txt b/gr-uhd/examples/CMakeLists.txt
new file mode 100644
index 000000000..91e2dfdaf
--- /dev/null
+++ b/gr-uhd/examples/CMakeLists.txt
@@ -0,0 +1,67 @@
+# 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_UHD_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+
+include_directories(${UHD_INCLUDE_DIRS})
+link_directories(${UHD_LIBRARY_DIRS})
+
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
+
+########################################################################
+# Build executable
+########################################################################
+add_executable(tags_demo tags_demo.cc)
+target_link_libraries(tags_demo gnuradio-uhd)
+
+########################################################################
+# Python examples
+########################################################################
+if(ENABLE_PYTHON)
+GR_PYTHON_INSTALL(
+ PROGRAMS
+ fm_tx4.py
+ fm_tx_2_daughterboards.py
+ max_power.py
+ usrp_am_mw_rcv.py
+ usrp_nbfm_ptt.py
+ usrp_nbfm_rcv.py
+ usrp_spectrum_sense.py
+ usrp_tv_rcv_nogui.py
+ usrp_tv_rcv.py
+ usrp_wfm_rcv2_nogui.py
+ usrp_wfm_rcv_fmdet.py
+ usrp_wfm_rcv_nogui.py
+ usrp_wfm_rcv_pll.py
+ usrp_wfm_rcv.py
+ usrp_wfm_rcv_sca.py
+ usrp_wxapt_rcv.py
+ DESTINATION ${GR_PKG_DATA_DIR}/examples/uhd
+ COMPONENT "uhd_python"
+)
+
+endif(ENABLE_PYTHON)
diff --git a/gr-uhd/grc/CMakeLists.txt b/gr-uhd/grc/CMakeLists.txt
new file mode 100644
index 000000000..3297db8d7
--- /dev/null
+++ b/gr-uhd/grc/CMakeLists.txt
@@ -0,0 +1,46 @@
+# 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.
+
+########################################################################
+# Rules for generating the source and sink xml wrappers
+########################################################################
+include(GrPython)
+
+macro(GEN_BLOCK_XML _generator _xml_block)
+ set(generator ${CMAKE_CURRENT_SOURCE_DIR}/${_generator})
+ set(xml_block ${CMAKE_CURRENT_BINARY_DIR}/${_xml_block})
+ list(APPEND xml_blocks ${xml_block})
+ add_custom_command(
+ DEPENDS ${generator} OUTPUT ${xml_block}
+ COMMAND ${PYTHON_EXECUTABLE} ${generator} ${xml_block}
+ )
+endmacro(GEN_BLOCK_XML)
+
+GEN_BLOCK_XML(gen_uhd_usrp_blocks.py uhd_usrp_source.xml)
+GEN_BLOCK_XML(gen_uhd_usrp_blocks.py uhd_usrp_sink.xml)
+
+add_custom_target(uhd_grc_xml_blocks ALL DEPENDS ${xml_blocks})
+
+install(FILES
+ ${xml_blocks}
+ uhd_amsg_source.xml
+ uhd_block_tree.xml
+ DESTINATION ${GRC_BLOCKS_DIR}
+ COMPONENT "uhd_python"
+)
diff --git a/gr-uhd/include/CMakeLists.txt b/gr-uhd/include/CMakeLists.txt
new file mode 100644
index 000000000..fdd384d58
--- /dev/null
+++ b/gr-uhd/include/CMakeLists.txt
@@ -0,0 +1,30 @@
+# 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_uhd_api.h
+ gr_uhd_usrp_source.h
+ gr_uhd_usrp_sink.h
+ gr_uhd_amsg_source.h
+ DESTINATION ${GR_INCLUDE_DIR}/gnuradio
+ COMPONENT "uhd_devel"
+)
diff --git a/gr-uhd/lib/CMakeLists.txt b/gr-uhd/lib/CMakeLists.txt
new file mode 100644
index 000000000..fbdca0566
--- /dev/null
+++ b/gr-uhd/lib/CMakeLists.txt
@@ -0,0 +1,58 @@
+# 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_UHD_INCLUDE_DIRS}
+)
+
+include_directories(${UHD_INCLUDE_DIRS})
+link_directories(${UHD_LIBRARY_DIRS})
+
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
+
+########################################################################
+# Setup library
+########################################################################
+list(APPEND gr_uhd_sources
+ gr_uhd_usrp_source.cc
+ gr_uhd_usrp_sink.cc
+ gr_uhd_amsg_source.cc
+)
+
+list(APPEND uhd_libs
+ gnuradio-core
+ ${Boost_LIBRARIES}
+ ${UHD_LIBRARIES}
+)
+
+add_library(gnuradio-uhd SHARED ${gr_uhd_sources})
+target_link_libraries(gnuradio-uhd ${uhd_libs})
+set_target_properties(gnuradio-uhd PROPERTIES DEFINE_SYMBOL "gnuradio_uhd_EXPORTS")
+set_target_properties(gnuradio-uhd PROPERTIES SOVERSION ${LIBVER})
+
+install(TARGETS gnuradio-uhd
+ LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "uhd_runtime" # .so/.dylib file
+ ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "uhd_devel" # .lib file
+ RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "uhd_runtime" # .dll file
+)
diff --git a/gr-uhd/swig/CMakeLists.txt b/gr-uhd/swig/CMakeLists.txt
new file mode 100644
index 000000000..4c778b05c
--- /dev/null
+++ b/gr-uhd/swig/CMakeLists.txt
@@ -0,0 +1,53 @@
+# 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_FLAGS -DGR_HAVE_UHD) #needed to parse uhd_swig.i
+
+set(GR_SWIG_INCLUDE_DIRS
+ ${GR_UHD_INCLUDE_DIRS}
+ ${GNURADIO_CORE_SWIG_INCLUDE_DIRS}
+)
+link_directories(${UHD_LIBRARY_DIRS})
+set(GR_SWIG_LIBRARIES gnuradio-uhd ${UHD_LIBRARIES})
+
+GR_SWIG_MAKE(uhd_swig uhd_swig.i)
+
+GR_SWIG_INSTALL(
+ TARGETS uhd_swig
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/uhd
+ COMPONENT "uhd_python"
+)
+
+install(
+ FILES uhd_swig.i
+ DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig
+ COMPONENT "uhd_swig"
+)
+
+GR_PYTHON_INSTALL(
+ FILES __init__.py
+ DESTINATION ${GR_PYTHON_DIR}/gnuradio/uhd
+ COMPONENT "uhd_python"
+)