From ab6f8142da17ee70effd469f20a41821b4bc4513 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 14:00:14 -0700 Subject: removes gcc warning, dont need symbol export on plain c structs --- gnuradio-core/src/lib/viterbi/viterbi.h | 2 +- volk/include/volk/volk_prefs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gnuradio-core/src/lib/viterbi/viterbi.h b/gnuradio-core/src/lib/viterbi/viterbi.h index 5bb8b357a..3a3ea5615 100644 --- a/gnuradio-core/src/lib/viterbi/viterbi.h +++ b/gnuradio-core/src/lib/viterbi/viterbi.h @@ -26,7 +26,7 @@ #include -struct GR_CORE_API viterbi_state { +struct viterbi_state { unsigned long path; /* Decoded path to this state */ long metric; /* Cumulative metric to this state */ }; diff --git a/volk/include/volk/volk_prefs.h b/volk/include/volk/volk_prefs.h index 2a7f7e79f..83d9baf89 100644 --- a/volk/include/volk/volk_prefs.h +++ b/volk/include/volk/volk_prefs.h @@ -5,7 +5,7 @@ __VOLK_DECL_BEGIN -struct VOLK_API volk_arch_pref { +struct volk_arch_pref { char name[128]; char arch[32]; }; -- cgit From dfe18fee44d1c03af186aeacd2adc97b6b129297 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 14:15:25 -0700 Subject: volk: give priority to generated includes (helps with dirty tree) --- volk/gen/make_makefile_am.py | 2 +- volk/lib/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/volk/gen/make_makefile_am.py b/volk/gen/make_makefile_am.py index f843b4413..0dc088a80 100644 --- a/volk/gen/make_makefile_am.py +++ b/volk/gen/make_makefile_am.py @@ -25,8 +25,8 @@ def make_makefile_am(dom, machines, archflags_dict): include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) \ - -I$(top_srcdir)/include \ -I$(top_gendir)/include \ + -I$(top_srcdir)/include \ -Dvolk_EXPORTS \ -fvisibility=hidden \ $(WITH_INCLUDES) diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index f4177b16e..e18d13677 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -231,10 +231,10 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) endif() include_directories( - ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} ) list(APPEND volk_sources -- cgit From f4ed279bba9924bf63b9b883906e7c83887fb3fe Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 14:40:15 -0700 Subject: utils: added cmake support for the gr-utils --- CMakeLists.txt | 1 + gr-utils/CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++++++ gr-utils/src/python/CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++++++ gr-wxgui/CMakeLists.txt | 6 ++--- 4 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 gr-utils/CMakeLists.txt create mode 100644 gr-utils/src/python/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index c175bdd77..6bd31dbe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,7 @@ add_subdirectory(gr-pager) add_subdirectory(gr-qtgui) add_subdirectory(gr-trellis) add_subdirectory(gr-uhd) +add_subdirectory(gr-utils) add_subdirectory(gr-video-sdl) add_subdirectory(gr-vocoder) add_subdirectory(gr-wxgui) diff --git a/gr-utils/CMakeLists.txt b/gr-utils/CMakeLists.txt new file mode 100644 index 000000000..38bb245c6 --- /dev/null +++ b/gr-utils/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 dependencies +######################################################################## + +######################################################################## +# Register component +######################################################################## +include(GrComponent) +GR_REGISTER_COMPONENT("gr-utils" ENABLE_GR_UTILS + ENABLE_GR_CORE + ENABLE_PYTHON +) + +######################################################################## +# Begin conditional configuration +######################################################################## +if(ENABLE_GR_UTILS) + +######################################################################## +# Setup CPack components +######################################################################## +include(GrPackage) +CPACK_COMPONENT("utils" + DISPLAY_NAME "Utils" + DESCRIPTION "Misc gnuradio python utilities" + DEPENDS "core_python" +) + +######################################################################## +# Add subdirectories +######################################################################## +add_subdirectory(src/python) + +endif(ENABLE_GR_UTILS) diff --git a/gr-utils/src/python/CMakeLists.txt b/gr-utils/src/python/CMakeLists.txt new file mode 100644 index 000000000..fba0d57a5 --- /dev/null +++ b/gr-utils/src/python/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. + +######################################################################## +# Install python files and apps +######################################################################## +include(GrPython) + +GR_PYTHON_INSTALL( + FILES + plot_data.py + pyqt_plot.py + pyqt_filter.py + DESTINATION ${GR_PYTHON_DIR}/gnuradio + COMPONENT "utils" +) + +GR_PYTHON_INSTALL( + PROGRAMS + create-gnuradio-out-of-tree-project + gr_plot_char.py + gr_plot_const.py + gr_plot_fft.py + gr_plot_fft_c.py + gr_plot_fft_f.py + gr_plot_psd.py + gr_plot_psd_c.py + gr_plot_psd_f.py + gr_plot_float.py + gr_plot_int.py + gr_plot_iq.py + gr_plot_short.py + gr_plot_qt.py + gr_filter_design.py + DESTINATION ${GR_RUNTIME_DIR} + COMPONENT "utils" +) diff --git a/gr-wxgui/CMakeLists.txt b/gr-wxgui/CMakeLists.txt index 54fe4fb64..5beb39f5e 100644 --- a/gr-wxgui/CMakeLists.txt +++ b/gr-wxgui/CMakeLists.txt @@ -29,7 +29,7 @@ GR_PYTHON_CHECK_MODULE("numpy" numpy True # Register component ######################################################################## include(GrComponent) -GR_REGISTER_COMPONENT("gr-wxgui" ENABLE_WXGUI +GR_REGISTER_COMPONENT("gr-wxgui" ENABLE_GR_WXGUI ENABLE_GR_CORE ENABLE_PYTHON NUMPY_FOUND @@ -39,7 +39,7 @@ GR_REGISTER_COMPONENT("gr-wxgui" ENABLE_WXGUI ######################################################################## # Begin conditional configuration ######################################################################## -if(ENABLE_WXGUI) +if(ENABLE_GR_WXGUI) ######################################################################## # Setup CPack components @@ -80,4 +80,4 @@ install( add_subdirectory(grc) add_subdirectory(src/python) -endif(ENABLE_WXGUI) +endif(ENABLE_GR_WXGUI) -- cgit From dd41a603b923092fb08595f88b036d0677e5e6d4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 15:15:08 -0700 Subject: misc fix missing installed files/tweaks --- CMakeLists.txt | 2 +- gr-digital/swig/CMakeLists.txt | 1 + gr-qtgui/lib/CMakeLists.txt | 2 +- gr-qtgui/lib/highResTimeFunctions.h | 36 ------------------------------------ gr-qtgui/swig/CMakeLists.txt | 1 + gr-vocoder/swig/CMakeLists.txt | 1 + 6 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 gr-qtgui/lib/highResTimeFunctions.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bd31dbe4..3b40f81e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,7 +92,7 @@ set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) set(GR_DOC_DIR ${GR_DATA_DIR}/doc) set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}-${LIBVER}) set(GR_CONF_DIR etc) -set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}) +set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) set(GR_LIBEXEC_DIR libexec) set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) diff --git a/gr-digital/swig/CMakeLists.txt b/gr-digital/swig/CMakeLists.txt index 4f4e51e33..3f97da5e3 100644 --- a/gr-digital/swig/CMakeLists.txt +++ b/gr-digital/swig/CMakeLists.txt @@ -40,6 +40,7 @@ GR_SWIG_INSTALL( install( FILES + digital_swig.i digital_binary_slicer_fb.i digital_clock_recovery_mm_cc.i digital_clock_recovery_mm_ff.i diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index 3290b1e77..ab6fedcf8 100644 --- a/gr-qtgui/lib/CMakeLists.txt +++ b/gr-qtgui/lib/CMakeLists.txt @@ -105,9 +105,9 @@ install(FILES WaterfallDisplayPlot.h waterfallGlobalData.h ConstellationDisplayPlot.h - highResTimeFunctions.h plot_waterfall.h spectrumdisplayform.h + timedisplayform.h SpectrumGUIClass.h spectrumUpdateEvents.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio diff --git a/gr-qtgui/lib/highResTimeFunctions.h b/gr-qtgui/lib/highResTimeFunctions.h deleted file mode 100644 index 6b3844901..000000000 --- a/gr-qtgui/lib/highResTimeFunctions.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * 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. - */ - -#ifndef HIGH_RES_TIME_FUNCTIONS_H -#define HIGH_RES_TIME_FUNCTIONS_H - -#include - -typedef gruel::high_res_timer_type highres_timespec; - -static inline highres_timespec -get_highres_clock() -{ - return gruel::high_res_timer_now(); -} - -#endif /* HIGH_RES_TIME_FUNCTIONS_H */ diff --git a/gr-qtgui/swig/CMakeLists.txt b/gr-qtgui/swig/CMakeLists.txt index 234af5a68..34b40fb7e 100644 --- a/gr-qtgui/swig/CMakeLists.txt +++ b/gr-qtgui/swig/CMakeLists.txt @@ -40,6 +40,7 @@ GR_SWIG_INSTALL( ) install(FILES + qtgui_swig.i qtgui_sink_c.i qtgui_sink_f.i qtgui_time_sink_c.i diff --git a/gr-vocoder/swig/CMakeLists.txt b/gr-vocoder/swig/CMakeLists.txt index 3a8e16ebf..2debfef72 100644 --- a/gr-vocoder/swig/CMakeLists.txt +++ b/gr-vocoder/swig/CMakeLists.txt @@ -40,6 +40,7 @@ GR_SWIG_INSTALL( install( FILES + vocoder_swig.i vocoder_alaw_decode_bs.i vocoder_alaw_encode_sb.i vocoder_codec2_decode_ps.i -- cgit From 1c95e89b0eafe063770ff98ee09f566843d1a68c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 18:58:05 -0700 Subject: cmake: parse the version.sh and git describe to model the m4 files --- CMakeLists.txt | 4 +- cmake/Modules/GrVersion.cmake | 88 +++++++++++++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b40f81e1..8b21f2e37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ set(GR_INCLUDE_DIR include) set(GR_DATA_DIR share) set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) set(GR_DOC_DIR ${GR_DATA_DIR}/doc) -set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}-${LIBVER}) +set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}-${DOCVER}) set(GR_CONF_DIR etc) set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) set(GR_LIBEXEC_DIR libexec) @@ -217,4 +217,4 @@ CPACK_FINALIZE() ######################################################################## GR_PRINT_COMPONENT_SUMMARY() message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") -message(STATUS "Building for version: ${VERSION}") +message(STATUS "Building for version: ${VERSION} / ${LIBVER}") diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 842537f18..79aa3e4b0 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -23,51 +23,81 @@ endif() set(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## -# Setup version variables. -# Parse the output of git describe -# sets VERSION and LIBVER +# Extract variables from version.sh ######################################################################## +message(STATUS "Extracting version information from version.sh...") +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "print open('${CMAKE_SOURCE_DIR}/version.sh').read().replace('=', ';').replace('\\n', ';')" + OUTPUT_VARIABLE VERSION_INFO OUTPUT_STRIP_TRAILING_WHITESPACE +) +include(CMakeParseArgumentsCopy) +CMAKE_PARSE_ARGUMENTS(VERSION_INFO "" "MAJOR_VERSION;API_COMPAT;MINOR_VERSION;MAINT_VERSION" "" ${VERSION_INFO}) -unset(VERSION) -unset(LIBVER) +#eventually, replace version.sh and fill in the variables below +set(MAJOR_VERSION ${VERSION_INFO_MAJOR_VERSION}) +set(API_COMPAT ${VERSION_INFO_API_COMPAT}) +set(MINOR_VERSION ${VERSION_INFO_MINOR_VERSION}) +set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION}) ######################################################################## # Extract the version string from git describe. ######################################################################## find_package(Git) + +unset(GIT_DESCRIBE) + if(GIT_FOUND) - message(STATUS "Extracting version information from git...") - execute_process(COMMAND ${GIT_EXECUTABLE} describe - OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE + message(STATUS "Extracting version information from git describe...") + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 + OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) - if(NOT VERSION) - message(WARNING "Tried to extract $VERSION from git describe but failed... using default") - endif() endif(GIT_FOUND) ######################################################################## -# Extract the library version from the version string. +# Parse the git describe string (currently unused) ######################################################################## -if(VERSION) - include(GrPython) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" - OUTPUT_VARIABLE LIBVER OUTPUT_STRIP_TRAILING_WHITESPACE +unset(GIT_TAG) +unset(GIT_SEQNO) +unset(GIT_COMMIT) + +if(GIT_DESCRIBE) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c + "import re; print ';'.join(re.match('^v(.*)-(.*)-g(.*)$', '${GIT_DESCRIBE}').groups())" + OUTPUT_VARIABLE GIT_DESCRIBES OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(NOT LIBVER) - message(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") - endif() -endif() + list(GET GIT_DESCRIBES 0 GIT_TAG) + list(GET GIT_DESCRIBES 1 GIT_SEQNO) + list(GET GIT_DESCRIBES 2 GIT_COMMIT) +endif(GIT_DESCRIBE) ######################################################################## -# Ensure that the version strings are set no matter what. +# Use the logic below to set the version constants ######################################################################## -if(NOT VERSION) - set(VERSION "v3.x.x-unknown") -endif() - -if(NOT LIBVER) - set(LIBVER "3.x.x") +if("${MINOR_VERSION}" STREQUAL "git") + # VERSION: 3.3git-xxx-gxxxxxxxx + # DOCVER: 3.3git + # LIBVER: 3.3git + set(VERSION "${GIT_DESCRIBE}") + set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}") + set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}") +elseif("${MAINT_VERSION}" STREQUAL "git") + # VERSION: 3.3.1git-xxx-gxxxxxxxx + # DOCVER: 3.3.1git + # LIBVER: 3.3.1git + set(VERSION "${GIT_DESCRIBE}") + set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}") + set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}") +else() + # This is a numbered release. + # VERSION: 3.3.1{.x} + # DOCVER: 3.3.1{.x} + # LIBVER: 3.3.1{.x} + set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}") + if("${MAINT_VERSION}" NOT STREQUAL "0") + set(VERSION "${VERSION}.${MAINT_VERSION}") + endif() + set(DOCVER "${VERSION}") + set(LIBVER "${VERSION}") endif() - -message(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") -- cgit From e44d194f944aa0a66a543286a36fa05c34c4db3e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 19:49:00 -0700 Subject: cmake: more tweaks for version extraction when git not found --- cmake/Modules/GrVersion.cmake | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 79aa3e4b0..16338f143 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -25,6 +25,7 @@ set(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## # Extract variables from version.sh ######################################################################## +include(GrPython) message(STATUS "Extracting version information from version.sh...") execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "print open('${CMAKE_SOURCE_DIR}/version.sh').read().replace('=', ';').replace('\\n', ';')" OUTPUT_VARIABLE VERSION_INFO OUTPUT_STRIP_TRAILING_WHITESPACE @@ -43,16 +44,16 @@ set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION}) ######################################################################## find_package(Git) -unset(GIT_DESCRIBE) - -if(GIT_FOUND) +if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) message(STATUS "Extracting version information from git describe...") execute_process( COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) -endif(GIT_FOUND) +else() + set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") +endif() ######################################################################## # Parse the git describe string (currently unused) @@ -64,7 +65,7 @@ unset(GIT_COMMIT) if(GIT_DESCRIBE) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c - "import re; print ';'.join(re.match('^v(.*)-(.*)-g(.*)$', '${GIT_DESCRIBE}').groups())" + "import re; print ';'.join(re.match('^v(.*)-(.*)-\\w(.*)$', '${GIT_DESCRIBE}').groups())" OUTPUT_VARIABLE GIT_DESCRIBES OUTPUT_STRIP_TRAILING_WHITESPACE ) list(GET GIT_DESCRIBES 0 GIT_TAG) @@ -94,9 +95,10 @@ else() # VERSION: 3.3.1{.x} # DOCVER: 3.3.1{.x} # LIBVER: 3.3.1{.x} - set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}") - if("${MAINT_VERSION}" NOT STREQUAL "0") - set(VERSION "${VERSION}.${MAINT_VERSION}") + if("${MAINT_VERSION}" STREQUAL "0") + set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}") + else() + set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}.${MAINT_VERSION}") endif() set(DOCVER "${VERSION}") set(LIBVER "${VERSION}") -- cgit From 7b1c5abe410470d25e49d0dadd265c430aaca1ec Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 22:36:24 -0700 Subject: pmt: fix #446 by putting pmt swig into namespace --- gruel/src/swig/pmt_swig.i | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gruel/src/swig/pmt_swig.i b/gruel/src/swig/pmt_swig.i index 34c7d4b7c..276d232a4 100644 --- a/gruel/src/swig/pmt_swig.i +++ b/gruel/src/swig/pmt_swig.i @@ -20,7 +20,6 @@ * Boston, MA 02110-1301, USA. */ -%module pmt %include "std_string.i" %include "stdint.i" %{ @@ -33,7 +32,6 @@ #include #include #include -using namespace pmt; %} //////////////////////////////////////////////////////////////////////// @@ -55,10 +53,14 @@ using namespace pmt; } // Template intrusive_ptr for Swig to avoid dereferencing issues -class pmt_base; +namespace pmt{ + class pmt_base; +} //%import %import -%template(swig_int_ptr) boost::intrusive_ptr; +%template(swig_int_ptr) boost::intrusive_ptr; + +namespace pmt{ typedef boost::intrusive_ptr pmt_t; @@ -777,3 +779,5 @@ std::string pmt_serialize_str(pmt_t obj); * \brief Provide a simple string generating interface to pmt's deserialize function */ pmt_t pmt_deserialize_str(std::string str); + +} //namespace pmt -- cgit From 9789365e056ccf1373a59f0e63f6f94f83f5073f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 22:38:57 -0700 Subject: tags: added swigging for gr_tags header --- gnuradio-core/CMakeLists.txt | 1 + gnuradio-core/src/lib/runtime/CMakeLists.txt | 1 + gnuradio-core/src/lib/runtime/Makefile.am | 1 + gnuradio-core/src/lib/runtime/gr_tags.h | 11 +++------- gnuradio-core/src/lib/runtime/gr_tags.i | 32 ++++++++++++++++++++++++++++ gnuradio-core/src/lib/runtime/runtime.i | 3 +++ gnuradio-core/src/lib/swig/CMakeLists.txt | 2 +- 7 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 gnuradio-core/src/lib/runtime/gr_tags.i diff --git a/gnuradio-core/CMakeLists.txt b/gnuradio-core/CMakeLists.txt index 029ff28a4..360a5c090 100644 --- a/gnuradio-core/CMakeLists.txt +++ b/gnuradio-core/CMakeLists.txt @@ -66,6 +66,7 @@ GR_SET_GLOBAL(GNURADIO_CORE_INCLUDE_DIRS ) GR_SET_GLOBAL(GNURADIO_CORE_SWIG_INCLUDE_DIRS + ${CMAKE_SOURCE_DIR}/gruel/src/swig ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/swig ${GNURADIO_CORE_INCLUDE_DIRS} ) diff --git a/gnuradio-core/src/lib/runtime/CMakeLists.txt b/gnuradio-core/src/lib/runtime/CMakeLists.txt index e0774154e..105fc0e06 100644 --- a/gnuradio-core/src/lib/runtime/CMakeLists.txt +++ b/gnuradio-core/src/lib/runtime/CMakeLists.txt @@ -153,6 +153,7 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gr_sync_block.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_sync_decimator.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_sync_interpolator.i + ${CMAKE_CURRENT_SOURCE_DIR}/gr_tags.i ${CMAKE_CURRENT_SOURCE_DIR}/gr_top_block.i ${CMAKE_CURRENT_SOURCE_DIR}/runtime.i DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am index d4233e1ba..38da3d5fd 100644 --- a/gnuradio-core/src/lib/runtime/Makefile.am +++ b/gnuradio-core/src/lib/runtime/Makefile.am @@ -160,5 +160,6 @@ swiginclude_HEADERS = \ gr_sync_block.i \ gr_sync_decimator.i \ gr_sync_interpolator.i \ + gr_tags.i \ gr_top_block.i \ runtime.i diff --git a/gnuradio-core/src/lib/runtime/gr_tags.h b/gnuradio-core/src/lib/runtime/gr_tags.h index e410e76a4..5fff6f15b 100644 --- a/gnuradio-core/src/lib/runtime/gr_tags.h +++ b/gnuradio-core/src/lib/runtime/gr_tags.h @@ -25,24 +25,19 @@ #include #include -//dummy namespace so the line below makes swig happy -namespace pmt{} -//stupid using namespace because pmt::pmt_t confuses swig -using namespace pmt; - struct GR_CORE_API gr_tag_t{ //! the item \p tag occurred at (as a uint64_t) uint64_t offset; //! the key of \p tag (as a PMT symbol) - pmt_t key; + pmt::pmt_t key; //! the value of \p tag (as a PMT) - pmt_t value; + pmt::pmt_t value; //! the source ID of \p tag (as a PMT) - pmt_t srcid; + pmt::pmt_t srcid; //! Comparison function to test which tag, \p x or \p y, came first in time static inline bool offset_compare( diff --git a/gnuradio-core/src/lib/runtime/gr_tags.i b/gnuradio-core/src/lib/runtime/gr_tags.i new file mode 100644 index 000000000..828d0147c --- /dev/null +++ b/gnuradio-core/src/lib/runtime/gr_tags.i @@ -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 +%} + +%include //for pmt support + +%include + +//gives support for a vector of tags (get tags in range) +%include "std_vector.i" +%template(tags_vector_t) std::vector; diff --git a/gnuradio-core/src/lib/runtime/runtime.i b/gnuradio-core/src/lib/runtime/runtime.i index ca89b8fbd..e08693a0c 100644 --- a/gnuradio-core/src/lib/runtime/runtime.i +++ b/gnuradio-core/src/lib/runtime/runtime.i @@ -20,6 +20,8 @@ * Boston, MA 02110-1301, USA. */ +#define GR_CORE_API + %{ #include #include @@ -64,4 +66,5 @@ %include %include %include +%include %include diff --git a/gnuradio-core/src/lib/swig/CMakeLists.txt b/gnuradio-core/src/lib/swig/CMakeLists.txt index 73a6f92ff..b10b7c186 100644 --- a/gnuradio-core/src/lib/swig/CMakeLists.txt +++ b/gnuradio-core/src/lib/swig/CMakeLists.txt @@ -28,7 +28,7 @@ set(GR_SWIG_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${GSL_INCLUDE_DIRS} ${GRUEL_INCLUDE_DIRS} - ${GNURADIO_CORE_INCLUDE_DIRS} + ${GNURADIO_CORE_SWIG_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ) set(GR_SWIG_LIBRARIES gnuradio-core) -- cgit From 31268cfb68965dbcf3df4912059f0c5b6d744626 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 21 Oct 2011 12:40:43 -0700 Subject: core: runtime.i dont include gr_tag.i, avoids pmt dependency --- gnuradio-core/src/lib/runtime/runtime.i | 1 - 1 file changed, 1 deletion(-) diff --git a/gnuradio-core/src/lib/runtime/runtime.i b/gnuradio-core/src/lib/runtime/runtime.i index e08693a0c..9bf2df31e 100644 --- a/gnuradio-core/src/lib/runtime/runtime.i +++ b/gnuradio-core/src/lib/runtime/runtime.i @@ -66,5 +66,4 @@ %include %include %include -%include %include -- cgit