diff options
Diffstat (limited to 'gr-uhd')
-rw-r--r-- | gr-uhd/CMakeLists.txt | 106 | ||||
-rw-r--r-- | gr-uhd/apps/CMakeLists.txt | 26 | ||||
-rw-r--r-- | gr-uhd/grc/CMakeLists.txt | 45 | ||||
-rw-r--r-- | gr-uhd/include/CMakeLists.txt | 29 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_sink.h | 1 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_source.h | 1 | ||||
-rw-r--r-- | gr-uhd/lib/CMakeLists.txt | 57 | ||||
-rw-r--r-- | gr-uhd/swig/CMakeLists.txt | 53 |
8 files changed, 316 insertions, 2 deletions
diff --git a/gr-uhd/CMakeLists.txt b/gr-uhd/CMakeLists.txt new file mode 100644 index 000000000..2e7e26ab0 --- /dev/null +++ b/gr-uhd/CMakeLists.txt @@ -0,0 +1,106 @@ +# 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) +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..33e3abe15 --- /dev/null +++ b/gr-uhd/apps/CMakeLists.txt @@ -0,0 +1,26 @@ +# 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 uhd_fft.py uhd_rx_cfile.py + DESTINATION ${GR_RUNTIME_DIR} + COMPONENT "uhd_python" +) diff --git a/gr-uhd/grc/CMakeLists.txt b/gr-uhd/grc/CMakeLists.txt new file mode 100644 index 000000000..9e1cdb015 --- /dev/null +++ b/gr-uhd/grc/CMakeLists.txt @@ -0,0 +1,45 @@ +# 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_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..d13f85c0f --- /dev/null +++ b/gr-uhd/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_uhd_api.h + gr_uhd_usrp_source.h + gr_uhd_usrp_sink.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "uhd_devel" +) diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index 320d07d41..2adc5f1bf 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -125,7 +125,6 @@ public: /*! * Get the actual dboard gain setting of named stage. - * \param name the name of the gain stage * \param chan the channel index 0 to N-1 * \return the actual gain in dB */ diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index 36331f782..6e51a1423 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -125,7 +125,6 @@ public: /*! * Get the actual dboard gain setting of named stage. - * \param name the name of the gain stage * \param chan the channel index 0 to N-1 * \return the actual gain in dB */ diff --git a/gr-uhd/lib/CMakeLists.txt b/gr-uhd/lib/CMakeLists.txt new file mode 100644 index 000000000..086126eb5 --- /dev/null +++ b/gr-uhd/lib/CMakeLists.txt @@ -0,0 +1,57 @@ +# 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 +) + +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..fec3cba6f --- /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" +) |