diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/Modules/FindUSB.cmake | 28 | ||||
-rw-r--r-- | gr-fcd/CMakeLists.txt | 109 | ||||
-rw-r--r-- | gr-fcd/include/fcd/CMakeLists.txt | 27 | ||||
-rw-r--r-- | gr-fcd/lib/CMakeLists.txt | 60 | ||||
-rw-r--r-- | gr-fcd/lib/fcd/CMakeLists.txt | 32 | ||||
-rw-r--r-- | gr-fcd/lib/hid/CMakeLists.txt | 39 | ||||
-rw-r--r-- | gr-fcd/python/CMakeLists.txt | 47 | ||||
-rw-r--r-- | gr-fcd/swig/CMakeLists.txt | 52 |
9 files changed, 395 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b6b5eb496..3bd0c35aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,7 @@ add_subdirectory(gr-shd) add_subdirectory(gr-utils) add_subdirectory(gr-video-sdl) add_subdirectory(gr-vocoder) +add_subdirectory(gr-fcd) add_subdirectory(gr-wxgui) add_subdirectory(gnuradio-examples/grc) add_subdirectory(gnuradio-examples/python) diff --git a/cmake/Modules/FindUSB.cmake b/cmake/Modules/FindUSB.cmake new file mode 100644 index 000000000..97f3db675 --- /dev/null +++ b/cmake/Modules/FindUSB.cmake @@ -0,0 +1,28 @@ +if(NOT LIBUSB_FOUND) + pkg_check_modules (LIBUSB_PKG libusb-1.0) + find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h + PATHS + ${LIBUSB_PKG_INCLUDE_DIRS} + /usr/include/libusb-1.0 + /usr/include + /usr/local/include + ) + + find_library(LIBUSB_LIBRARIES NAMES usb-1.0 + PATHS + ${LIBUSB_PKG_LIBRARY_DIRS} + /usr/lib + /usr/local/lib + ) + +if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found") + message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}") +else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found") + message(STATUS "libusb-1.0 not found.") +endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES) + +mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES) + +endif(NOT LIBUSB_FOUND) diff --git a/gr-fcd/CMakeLists.txt b/gr-fcd/CMakeLists.txt new file mode 100644 index 000000000..0bb4bfb4f --- /dev/null +++ b/gr-fcd/CMakeLists.txt @@ -0,0 +1,109 @@ +# Copyright 2012 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) +if(NOT WIN32 AND NOT MACOSX) + include(FindUSB) +endif() + +######################################################################## +# Register component +######################################################################## +include(GrComponent) +GR_REGISTER_COMPONENT("gr-fcd" ENABLE_GR_FCD + Boost_FOUND + ENABLE_GR_CORE + ENABLE_GR_AUDIO + LIBUSB_FOUND +) + +GR_SET_GLOBAL(GR_FCD_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/lib + ${CMAKE_CURRENT_SOURCE_DIR}/include/fcd +) + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_GR_FCD) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_SET(CPACK_COMPONENT_GROUP_FCD_DESCRIPTION "GNU Radio FCD Blocks") + +CPACK_COMPONENT("fcd_runtime" + GROUP "FCD" + DISPLAY_NAME "Runtime" + DESCRIPTION "Runtime" + DEPENDS "core_runtime;audio_runtime" +) + +CPACK_COMPONENT("fcd_devel" + GROUP "FCD" + DISPLAY_NAME "Development" + DESCRIPTION "C++ headers, package config, import libraries" + DEPENDS "core_devel;audio_devel" +) + +CPACK_COMPONENT("fcd_python" + GROUP "FCD" + DISPLAY_NAME "Python" + DESCRIPTION "Python modules for runtime; GRC xml files" + DEPENDS "core_python;fcd_runtime" +) + +CPACK_COMPONENT("fcd_swig" + GROUP "FCD" + DISPLAY_NAME "SWIG" + DESCRIPTION "SWIG development .i files" + DEPENDS "core_swig;fcd_python;fcd_devel" +) + +######################################################################## +# Add subdirectories +######################################################################## +add_subdirectory(include/fcd) +add_subdirectory(lib) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(python) +# add_subdirectory(grc) +endif(ENABLE_PYTHON) +#add_subdirectory(apps) + +######################################################################## +# Create Pkg Config File +######################################################################## +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/gnuradio-fcd.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-fcd.pc +@ONLY) + +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/gnuradio-fcd.pc + DESTINATION ${GR_LIBRARY_DIR}/pkgconfig + COMPONENT "fcd_devel" +) + +endif(ENABLE_GR_FCD) diff --git a/gr-fcd/include/fcd/CMakeLists.txt b/gr-fcd/include/fcd/CMakeLists.txt new file mode 100644 index 000000000..bd3a73511 --- /dev/null +++ b/gr-fcd/include/fcd/CMakeLists.txt @@ -0,0 +1,27 @@ +# 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 + fcd_source_c.h + DESTINATION ${GR_INCLUDE_DIR}/gnuradio + COMPONENT "fcd_devel" +) diff --git a/gr-fcd/lib/CMakeLists.txt b/gr-fcd/lib/CMakeLists.txt new file mode 100644 index 000000000..b41037d4a --- /dev/null +++ b/gr-fcd/lib/CMakeLists.txt @@ -0,0 +1,60 @@ +# Copyright 2012 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. + +GR_INCLUDE_SUBDIRECTORY(hid) +GR_INCLUDE_SUBDIRECTORY(fcd) + +######################################################################## +# Setup the include and linker paths +######################################################################## +include_directories( + ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_FCD_INCLUDE_DIRS} + ${GR_AUDIO_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/hid + ${CMAKE_CURRENT_SOURCE_DIR}/fcd + ${LIBUSB_INCLUDE_DIR} +) + +include_directories(${Boost_INCLUDE_DIRS}) +link_directories(${Boost_LIBRARY_DIRS}) + +######################################################################## +# Setup library +######################################################################## +list(APPEND gr_fcd_sources + fcd_source_c.cc +) + +list(APPEND fcd_libs + gnuradio-core + gnuradio-audio + ${Boost_LIBRARIES} +) + +if(NOT WIN32 AND NOT MACOSX) + list(APPEND fcd_libs + ${LIBUSB_LIBRARIES} + ) +endif() + + +add_library(gnuradio-fcd SHARED ${gr_fcd_sources}) +target_link_libraries(gnuradio-fcd ${fcd_libs}) +GR_LIBRARY_FOO(gnuradio-fcd RUNTIME_COMPONENT "fcd_runtime" DEVEL_COMPONENT "fcd_devel") diff --git a/gr-fcd/lib/fcd/CMakeLists.txt b/gr-fcd/lib/fcd/CMakeLists.txt new file mode 100644 index 000000000..416a7507e --- /dev/null +++ b/gr-fcd/lib/fcd/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright 2012 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. + +######################################################################## +# This file included, use CMake directory variables +######################################################################## + +include_directories(APPEND ${USB_INCLUDES}) + +set(fcd_sources ${CMAKE_CURRENT_SOURCE_DIR}/fcd.c) + + +######################################################################## +# Append gnuradio-fcd library sources +######################################################################## +list(APPEND gr_fcd_sources ${fcd_sources}) diff --git a/gr-fcd/lib/hid/CMakeLists.txt b/gr-fcd/lib/hid/CMakeLists.txt new file mode 100644 index 000000000..d18e977c2 --- /dev/null +++ b/gr-fcd/lib/hid/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright 2012 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. + +######################################################################## +# This file included, use CMake directory variables +######################################################################## + +include_directories(APPEND ${USB_INCLUDES}) + +set(hid_sources) + +if(WIN32) + list(APPEND hid_sources ${CMAKE_CURRENT_SOURCE_DIR}/hidwin.c) +elseif(MACOSX) + list(APPEND hid_sources ${CMAKE_CURRENT_SOURCE_DIR}/hidmac.c) +else() + list(APPEND hid_sources ${CMAKE_CURRENT_SOURCE_DIR}/hid-libusb.c) +endif() + +######################################################################## +# Append gnuradio-fcd library sources +######################################################################## +list(APPEND gr_fcd_sources ${hid_sources}) diff --git a/gr-fcd/python/CMakeLists.txt b/gr-fcd/python/CMakeLists.txt new file mode 100644 index 000000000..1c5dde35f --- /dev/null +++ b/gr-fcd/python/CMakeLists.txt @@ -0,0 +1,47 @@ +# Copyright 2012 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( + FILES + __init__.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio/fcd + COMPONENT "fcd_python" +) + +######################################################################## +# Handle the unit tests +######################################################################## +if(ENABLE_TESTING) +include(GrTest) +file(GLOB py_qa_test_files "qa_*.py") +foreach(py_qa_test_file ${py_qa_test_files}) + get_filename_component(py_qa_test_name ${py_qa_test_file} NAME_WE) + set(GR_TEST_PYTHON_DIRS + ${CMAKE_BINARY_DIR}/gnuradio-core/src/python + ${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig + ${CMAKE_BINARY_DIR}/gr-fcd/python + ${CMAKE_BINARY_DIR}/gr-fcd/swig + ) + set(GR_TEST_TARGET_DEPS gruel gnuradio-core gnuradio-audio gnuradio-fcd) + GR_ADD_TEST(${py_qa_test_name} ${PYTHON_EXECUTABLE} ${py_qa_test_file}) +endforeach(py_qa_test_file) +endif(ENABLE_TESTING) diff --git a/gr-fcd/swig/CMakeLists.txt b/gr-fcd/swig/CMakeLists.txt new file mode 100644 index 000000000..7d881c0b4 --- /dev/null +++ b/gr-fcd/swig/CMakeLists.txt @@ -0,0 +1,52 @@ +# Copyright 2012 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_FCD_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} + ${GR_AUDIO_INCLUDE_DIRS} +) + +set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/fcd_swig_doc.i) +set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib) + +set(GR_SWIG_LIBRARIES gnuradio-fcd) + +GR_SWIG_MAKE(fcd_swig fcd_swig.i) + +GR_SWIG_INSTALL( + TARGETS fcd_swig + DESTINATION ${GR_PYTHON_DIR}/gnuradio/fcd + COMPONENT "fcd_python" +) + +install( + FILES + fcd_swig.i + fcd_source_c.i + ${CMAKE_CURRENT_BINARY_DIR}/fcd_swig_doc.i + DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig + COMPONENT "fcd_swig" +) |