diff options
author | Johnathan Corgan | 2012-03-11 15:18:15 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-03-11 19:37:40 -0700 |
commit | 72576bd2d87b83ccc1661b695278e0dee8fe21a4 (patch) | |
tree | 045f8e269cd98b9574be9ccceff6eaea61ad4b10 /gr-fcd | |
parent | 9f9b2f0b7527b1a82dfad5337c33fac5aef30ca4 (diff) | |
download | gnuradio-72576bd2d87b83ccc1661b695278e0dee8fe21a4.tar.gz gnuradio-72576bd2d87b83ccc1661b695278e0dee8fe21a4.tar.bz2 gnuradio-72576bd2d87b83ccc1661b695278e0dee8fe21a4.zip |
fcd: cmake build work in progress
Diffstat (limited to 'gr-fcd')
-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 |
7 files changed, 366 insertions, 0 deletions
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" +) |