diff options
Diffstat (limited to 'gr-shd')
-rw-r--r-- | gr-shd/CMakeLists.txt | 127 | ||||
-rw-r--r-- | gr-shd/apps/CMakeLists.txt | 32 | ||||
-rw-r--r-- | gr-shd/apps/Makefile.am | 3 | ||||
-rw-r--r-- | gr-shd/grc/CMakeLists.txt | 45 | ||||
-rw-r--r-- | gr-shd/include/CMakeLists.txt | 29 | ||||
-rw-r--r-- | gr-shd/lib/CMakeLists.txt | 50 | ||||
-rw-r--r-- | gr-shd/swig/CMakeLists.txt | 53 |
7 files changed, 338 insertions, 1 deletions
diff --git a/gr-shd/CMakeLists.txt b/gr-shd/CMakeLists.txt new file mode 100644 index 000000000..de9daf540 --- /dev/null +++ b/gr-shd/CMakeLists.txt @@ -0,0 +1,127 @@ +# 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) + +PKG_CHECK_MODULES(PC_SHD shd QUIET) +FIND_PATH( + SHD_INCLUDE_DIRS + NAMES shd/config.hpp + HINTS $ENV{SHD_DIR}/include + ${PC_SHD_INCLUDE_DIRS} + PATHS /usr/local/include + /usr/include +) + +FIND_LIBRARY( + SHD_LIBRARIES + NAMES shd + HINTS $ENV{SHD_DIR}/lib + ${PC_SHD_LIBRARIES} + PATHS /usr/local/lib + /usr/lib +) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SHD DEFAULT_MSG SHD_LIBRARIES SHD_INCLUDE_DIRS) +MARK_AS_ADVANCED(SHD_LIBRARIES SHD_INCLUDE_DIRS) + +######################################################################## +# Register component +######################################################################## +include(GrComponent) +GR_REGISTER_COMPONENT("gr-shd" ENABLE_GR_SHD + Boost_FOUND + SHD_FOUND + ENABLE_GR_CORE +) + +GR_SET_GLOBAL(GR_SHD_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${SHD_INCLUDE_DIRS} +) + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_GR_SHD) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_SHD_DESCRIPTION "GNU Radio SHD Blocks") + +CPACK_COMPONENT("shd_runtime" + GROUP "SHD" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime" +) + +CPACK_COMPONENT("shd_devel" + GROUP "SHD" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel" +) + +CPACK_COMPONENT("shd_python" + GROUP "SHD" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;shd_runtime" +) + +CPACK_COMPONENT("shd_swig" + GROUP "SHD" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;shd_python;shd_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-shd.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-shd.pc +@ONLY) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-shd.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "shd_devel" +) + +endif(ENABLE_GR_SHD) diff --git a/gr-shd/apps/CMakeLists.txt b/gr-shd/apps/CMakeLists.txt new file mode 100644 index 000000000..3930abb57 --- /dev/null +++ b/gr-shd/apps/CMakeLists.txt @@ -0,0 +1,32 @@ +# 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 shd apps +######################################################################## +GR_PYTHON_INSTALL( + PROGRAMS + shd_fft.py + shd_rx_cfile.py + shd_siggen.py + DESTINATION ${GR_RUNTIME_DIR} + COMPONENT "shd_python" +) diff --git a/gr-shd/apps/Makefile.am b/gr-shd/apps/Makefile.am index 16837f575..ac50e892e 100644 --- a/gr-shd/apps/Makefile.am +++ b/gr-shd/apps/Makefile.am @@ -28,5 +28,6 @@ ourpythondir = $(grpythondir) bin_SCRIPTS = \ shd_fft.py \ - shd_rx_cfile.py + shd_rx_cfile.py \ + shd_siggen.py diff --git a/gr-shd/grc/CMakeLists.txt b/gr-shd/grc/CMakeLists.txt new file mode 100644 index 000000000..f35d36ba3 --- /dev/null +++ b/gr-shd/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_shd_smini_blocks.py shd_smini_source.xml) +GEN_BLOCK_XML(gen_shd_smini_blocks.py shd_smini_sink.xml) + +add_custom_target(shd_grc_xml_blocks ALL DEPENDS ${xml_blocks}) + +install(FILES + ${xml_blocks} + shd_block_tree.xml + DESTINATION ${GRC_BLOCKS_DIR} + COMPONENT "shd_python" +) diff --git a/gr-shd/include/CMakeLists.txt b/gr-shd/include/CMakeLists.txt new file mode 100644 index 000000000..c4db1fd22 --- /dev/null +++ b/gr-shd/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_shd_api.h + gr_shd_smini_source.h + gr_shd_smini_sink.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "shd_devel" +) diff --git a/gr-shd/lib/CMakeLists.txt b/gr-shd/lib/CMakeLists.txt new file mode 100644 index 000000000..e8528fddb --- /dev/null +++ b/gr-shd/lib/CMakeLists.txt @@ -0,0 +1,50 @@ +# 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_SHD_INCLUDE_DIRS} +) + +include_directories(${SHD_INCLUDE_DIRS}) +link_directories(${SHD_LIBRARY_DIRS}) + +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Setup library +######################################################################## +list(APPEND gr_shd_sources + gr_shd_smini_source.cc + gr_shd_smini_sink.cc +) + +list(APPEND shd_libs + gnuradio-core + ${Boost_LIBRARIES} + ${SHD_LIBRARIES} +) + +add_library(gnuradio-shd SHARED ${gr_shd_sources}) +target_link_libraries(gnuradio-shd ${shd_libs}) +GR_LIBRARY_FOO(gnuradio-shd RUNTIME_COMPONENT "shd_runtime" DEVEL_COMPONENT "shd_devel") diff --git a/gr-shd/swig/CMakeLists.txt b/gr-shd/swig/CMakeLists.txt new file mode 100644 index 000000000..e2c345be7 --- /dev/null +++ b/gr-shd/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_SHD) #needed to parse shd_swig.i + +set(GR_SWIG_INCLUDE_DIRS + ${GR_SHD_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} +) +link_directories(${SHD_LIBRARY_DIRS}) +set(GR_SWIG_LIBRARIES gnuradio-shd ${SHD_LIBRARIES}) + +GR_SWIG_MAKE(shd_swig shd_swig.i) + +GR_SWIG_INSTALL( + TARGETS shd_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/shd + COMPONENT "shd_python" +) + +install( + FILES shd_swig.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "shd_swig" +) + +GR_PYTHON_INSTALL( + FILES __init__.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/shd + COMPONENT "shd_python" +) |