Skip to content

Commit ce21160

Browse files
committed
Merge branch 'master' into gr_log
Conflicts: cmake/Modules/GrMiscUtils.cmake docs/doxygen/other/main_page.dox gnuradio-core/gnuradio-core.conf.in gnuradio-core/src/lib/swig/CMakeLists.txt gr-digital/lib/CMakeLists.txt gr-howto-write-a-block/CMakeLists.txt gr-qtgui/lib/CMakeLists.txt gr-video-sdl/src/CMakeLists.txt
2 parents 6121d0b + 4c164f4 commit ce21160

File tree

921 files changed

+69456
-2329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

921 files changed

+69456
-2329
lines changed

CMakeLists.txt

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2010-2011 Free Software Foundation, Inc.
1+
# Copyright 2010-2012 Free Software Foundation, Inc.
22
#
33
# This file is part of GNU Radio
44
#
@@ -41,14 +41,21 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
4141
# Set the version information here
4242
set(VERSION_INFO_MAJOR_VERSION 3)
4343
set(VERSION_INFO_API_COMPAT 6)
44-
set(VERSION_INFO_MINOR_VERSION 3)
44+
set(VERSION_INFO_MINOR_VERSION 5)
4545
set(VERSION_INFO_MAINT_VERSION git)
4646
include(GrVersion) #setup version info
4747

4848
# Append -O2 optimization flag for Debug builds
4949
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
5050
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
5151

52+
########################################################################
53+
# Environment setup
54+
########################################################################
55+
IF(NOT DEFINED BOOST_ROOT)
56+
SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
57+
ENDIF()
58+
5259
########################################################################
5360
# Import executables from a native build (for cross compiling)
5461
# http://www.vtk.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build
@@ -110,6 +117,14 @@ set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks)
110117
set(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/${GR_CONF_DIR}" CACHE PATH "System configuration directory")
111118
set(GR_PREFSDIR ${SYSCONFDIR}/${CMAKE_PROJECT_NAME}/conf.d)
112119

120+
OPTION(ENABLE_PERFORMANCE_COUNTERS "Enable block performance counters" OFF)
121+
if(ENABLE_PERFORMANCE_COUNTERS)
122+
message(STATUS "ADDING PERF COUNTERS")
123+
add_definitions(-DGR_PERFORMANCE_COUNTERS)
124+
else(ENABLE_PERFORMANCE_COUNTERS)
125+
message(STATUS "NO PERF COUNTERS")
126+
endif(ENABLE_PERFORMANCE_COUNTERS)
127+
113128
########################################################################
114129
# Variables replaced when configuring the package config files
115130
########################################################################
@@ -223,6 +238,16 @@ install(
223238
COMPONENT "docs"
224239
)
225240

241+
########################################################################
242+
# The following dependency libraries are needed by all gr modules:
243+
########################################################################
244+
list(APPEND GR_TEST_TARGET_DEPS volk gruel gnuradio-core)
245+
list(APPEND GR_TEST_PYTHON_DIRS
246+
${CMAKE_SOURCE_DIR}/gruel/src/python
247+
${CMAKE_BINARY_DIR}/gruel/src/swig
248+
${CMAKE_BINARY_DIR}/gnuradio-core/src/python
249+
${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig
250+
)
226251

227252
########################################################################
228253
# Add subdirectories (in order of deps)
@@ -237,6 +262,7 @@ add_subdirectory(gr-filter)
237262
add_subdirectory(gr-atsc)
238263
add_subdirectory(gr-audio)
239264
add_subdirectory(gr-comedi)
265+
add_subdirectory(gr-analog)
240266
add_subdirectory(gr-digital)
241267
add_subdirectory(gr-noaa)
242268
add_subdirectory(gr-pager)
@@ -250,6 +276,7 @@ add_subdirectory(gr-vocoder)
250276
add_subdirectory(gr-fcd)
251277
add_subdirectory(gr-wavelet)
252278
add_subdirectory(gr-wxgui)
279+
add_subdirectory(gr-blocks)
253280

254281
#finalize cpack after subdirs processed
255282
include(GrPackage)

cmake/Modules/FindQwt.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ find_path (QWT_INCLUDE_DIRS
1111
/usr/include/qwt-qt4
1212
/usr/include/qwt
1313
/opt/local/include/qwt
14+
/opt/local/lib/qwt.framework/Headers
1415
/sw/include/qwt
1516
)
1617

@@ -20,6 +21,7 @@ find_library (QWT_LIBRARIES
2021
/usr/local/lib
2122
/usr/lib
2223
/opt/local/lib
24+
/opt/local/lib/qwt.framework
2325
/sw/lib
2426
)
2527

cmake/Modules/GrBoost.cmake

+40-3
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ set(BOOST_REQUIRED_COMPONENTS
3434
thread
3535
)
3636

37-
if(UNIX AND EXISTS "/usr/lib64")
37+
if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
3838
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
39-
endif(UNIX AND EXISTS "/usr/lib64")
39+
endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
4040

4141
if(MSVC)
42+
set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono)
43+
4244
if (NOT DEFINED BOOST_ALL_DYN_LINK)
4345
set(BOOST_ALL_DYN_LINK TRUE)
4446
endif()
@@ -50,6 +52,12 @@ if(MSVC)
5052
endif(BOOST_ALL_DYN_LINK)
5153
endif(MSVC)
5254

55+
find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
56+
57+
# This does not allow us to disable specific versions. It is used
58+
# internally by cmake to know the formation newer versions. As newer
59+
# Boost version beyond what is shown here are produced, we must extend
60+
# this list. To disable Boost versions, see below.
5361
set(Boost_ADDITIONAL_VERSIONS
5462
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
5563
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
@@ -59,4 +67,33 @@ set(Boost_ADDITIONAL_VERSIONS
5967
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
6068
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
6169
)
62-
find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
70+
71+
# Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669
72+
# Similar problems with Boost 1.46 and 1.47.
73+
74+
OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF)
75+
if(ENABLE_BAD_BOOST)
76+
MESSAGE(STATUS "Enabling use of known bad versions of Boost.")
77+
endif(ENABLE_BAD_BOOST)
78+
79+
# For any unsuitable Boost version, add the version number below in
80+
# the following format: XXYYZZ
81+
# Where:
82+
# XX is the major version ('10' for version 1)
83+
# YY is the minor version number ('46' for 1.46)
84+
# ZZ is the patcher version number (typically just '00')
85+
set(Boost_NOGO_VERSIONS
86+
104600 104601 104700 105200
87+
)
88+
89+
foreach(ver ${Boost_NOGO_VERSIONS})
90+
if(${Boost_VERSION} EQUAL ${ver})
91+
if(NOT ENABLE_BAD_BOOST)
92+
MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.")
93+
set(Boost_FOUND FALSE)
94+
else(NOT ENABLE_BAD_BOOST)
95+
MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.")
96+
set(Boost_FOUND TRUE)
97+
endif(NOT ENABLE_BAD_BOOST)
98+
endif(${Boost_VERSION} EQUAL ${ver})
99+
endforeach(ver)

cmake/Modules/GrMiscUtils.cmake

+66
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,69 @@ function(GR_LOGGING)
241241
SET(LOG4CXX_LIBRARIES "" CACHE INTERNAL "" FORCE)
242242
endif(ENABLE_GR_LOG)
243243
endfunction(GR_LOGGING)
244+
245+
########################################################################
246+
# Run GRCC to compile .grc files into .py files.
247+
#
248+
# Usage: GRCC(filename, directory)
249+
# - filenames: List of file name of .grc file
250+
# - directory: directory of built .py file - usually in
251+
# ${CMAKE_CURRENT_BINARY_DIR}
252+
# - Sets PYFILES: output converted GRC file names to Python files.
253+
########################################################################
254+
function(GRCC)
255+
# Extract directory from list of args, remove it for the list of filenames.
256+
list(GET ARGV -1 directory)
257+
list(REMOVE_AT ARGV -1)
258+
set(filenames ${ARGV})
259+
file(MAKE_DIRECTORY ${directory})
260+
261+
SET(GRCC_COMMAND ${CMAKE_SOURCE_DIR}/gr-utils/src/python/grcc)
262+
263+
# GRCC uses some stuff in grc and gnuradio-core, so we force
264+
# the known paths here
265+
list(APPEND PYTHONPATHS
266+
${CMAKE_SOURCE_DIR}
267+
${CMAKE_SOURCE_DIR}/gnuradio-core/src/python
268+
${CMAKE_SOURCE_DIR}/gnuradio-core/src/lib/swig
269+
${CMAKE_BINARY_DIR}/gnuradio-core/src/lib/swig
270+
)
271+
272+
if(WIN32)
273+
#SWIG generates the python library files into a subdirectory.
274+
#Therefore, we must append this subdirectory into PYTHONPATH.
275+
#Only do this for the python directories matching the following:
276+
foreach(pydir ${PYTHONPATHS})
277+
get_filename_component(name ${pydir} NAME)
278+
if(name MATCHES "^(swig|lib|src)$")
279+
list(APPEND PYTHONPATHS ${pydir}/${CMAKE_BUILD_TYPE})
280+
endif()
281+
endforeach(pydir)
282+
endif(WIN32)
283+
284+
file(TO_NATIVE_PATH "${PYTHONPATHS}" pypath)
285+
286+
if(UNIX)
287+
list(APPEND pypath "$PYTHONPATH")
288+
string(REPLACE ";" ":" pypath "${pypath}")
289+
set(ENV{PYTHONPATH} ${pypath})
290+
endif(UNIX)
291+
292+
if(WIN32)
293+
list(APPEND pypath "%PYTHONPATH%")
294+
string(REPLACE ";" "\\;" pypath "${pypath}")
295+
#list(APPEND environs "PYTHONPATH=${pypath}")
296+
set(ENV{PYTHONPATH} ${pypath})
297+
endif(WIN32)
298+
299+
foreach(f ${filenames})
300+
execute_process(
301+
COMMAND ${GRCC_COMMAND} -d ${directory} ${f}
302+
)
303+
string(REPLACE ".grc" ".py" pyfile "${f}")
304+
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" pyfile "${pyfile}")
305+
list(APPEND pyfiles ${pyfile})
306+
endforeach(f)
307+
308+
set(PYFILES ${pyfiles} PARENT_SCOPE)
309+
endfunction(GRCC)

cmake/Modules/GrPython.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,13 @@ endmacro(GR_PYTHON_CHECK_MODULE)
9696
########################################################################
9797
# Sets the python installation directory GR_PYTHON_DIR
9898
########################################################################
99+
if(NOT DEFINED GR_PYTHON_DIR)
99100
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
100101
from distutils import sysconfig
101102
print sysconfig.get_python_lib(plat_specific=True, prefix='')
102103
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
103104
)
105+
endif()
104106
file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
105107

106108
########################################################################

cmake/Modules/GrSetupQt4.cmake

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Copyright 2013 Free Software Foundation, Inc.
2+
#
3+
# This file is part of GNU Radio
4+
#
5+
# GNU Radio is free software; you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation; either version 3, or (at your option)
8+
# any later version.
9+
#
10+
# GNU Radio is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with GNU Radio; see the file COPYING. If not, write to
17+
# the Free Software Foundation, Inc., 51 Franklin Street,
18+
# Boston, MA 02110-1301, USA.
19+
20+
if(DEFINED __INCLUDED_GR_USEQT4_CMAKE)
21+
return()
22+
endif()
23+
set(__INCLUDED_GR_USEQT4_CMAKE TRUE)
24+
25+
# This file is derived from the default "UseQt4" file provided by
26+
# CMake. This version sets the variables "QT_INCLUDE_DIRS",
27+
# "QT_LIBRARIES", and "QT_LIBRARIES_PLUGINS" depending on those
28+
# requested during the "find_package(Qt4 ...)" function call, but
29+
# without actually adding them to the include or library search
30+
# directories ("include_directories" or "link_directories"). The
31+
# adding in is done by the CMakeLists.txt build scripts in the using
32+
# project.
33+
34+
# Copyright from the original file, as required by the license.
35+
################################################################
36+
# CMake - Cross Platform Makefile Generator
37+
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
38+
# All rights reserved.
39+
#
40+
# Redistribution and use in source and binary forms, with or without
41+
# modification, are permitted provided that the following conditions
42+
# are met:
43+
#
44+
# * Redistributions of source code must retain the above copyright
45+
# notice, this list of conditions and the following disclaimer.
46+
#
47+
# * Redistributions in binary form must reproduce the above copyright
48+
# notice, this list of conditions and the following disclaimer in the
49+
# documentation and/or other materials provided with the distribution.
50+
#
51+
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
52+
# nor the names of their contributors may be used to endorse or promote
53+
# products derived from this software without specific prior written
54+
# permission.
55+
#
56+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
57+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
58+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
59+
# # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
60+
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
61+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
62+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
66+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67+
################################################################
68+
69+
ADD_DEFINITIONS(${QT_DEFINITIONS})
70+
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG QT_DEBUG)
71+
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
72+
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
73+
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
74+
IF(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
75+
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS QT_NO_DEBUG)
76+
ENDIF()
77+
78+
SET(QT_INCLUDE_DIRS ${QT_INCLUDE_DIR})
79+
SET(QT_LIBRARIES "")
80+
SET(QT_LIBRARIES_PLUGINS "")
81+
82+
IF (QT_USE_QTMAIN)
83+
IF (Q_WS_WIN)
84+
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY})
85+
ENDIF (Q_WS_WIN)
86+
ENDIF (QT_USE_QTMAIN)
87+
88+
IF(QT_DONT_USE_QTGUI)
89+
SET(QT_USE_QTGUI 0)
90+
ELSE(QT_DONT_USE_QTGUI)
91+
SET(QT_USE_QTGUI 1)
92+
ENDIF(QT_DONT_USE_QTGUI)
93+
94+
IF(QT_DONT_USE_QTCORE)
95+
SET(QT_USE_QTCORE 0)
96+
ELSE(QT_DONT_USE_QTCORE)
97+
SET(QT_USE_QTCORE 1)
98+
ENDIF(QT_DONT_USE_QTCORE)
99+
100+
IF (QT_USE_QT3SUPPORT)
101+
ADD_DEFINITIONS(-DQT3_SUPPORT)
102+
ENDIF (QT_USE_QT3SUPPORT)
103+
104+
# list dependent modules, so dependent libraries are added
105+
SET(QT_QT3SUPPORT_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
106+
SET(QT_QTSVG_MODULE_DEPENDS QTGUI QTXML QTCORE)
107+
SET(QT_QTUITOOLS_MODULE_DEPENDS QTGUI QTXML QTCORE)
108+
SET(QT_QTHELP_MODULE_DEPENDS QTGUI QTSQL QTXML QTNETWORK QTCORE)
109+
IF(QT_QTDBUS_FOUND)
110+
SET(QT_PHONON_MODULE_DEPENDS QTGUI QTDBUS QTCORE)
111+
ELSE(QT_QTDBUS_FOUND)
112+
SET(QT_PHONON_MODULE_DEPENDS QTGUI QTCORE)
113+
ENDIF(QT_QTDBUS_FOUND)
114+
SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE)
115+
SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE)
116+
SET(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE)
117+
SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE)
118+
SET(QT_QTSCRIPTTOOLS_MODULE_DEPENDS QTGUI QTCORE)
119+
SET(QT_QTWEBKIT_MODULE_DEPENDS QTXMLPATTERNS QTGUI QTCORE)
120+
SET(QT_QTDECLARATIVE_MODULE_DEPENDS QTSCRIPT QTSVG QTSQL QTXMLPATTERNS QTGUI QTCORE)
121+
SET(QT_QTMULTIMEDIA_MODULE_DEPENDS QTGUI QTCORE)
122+
SET(QT_QTOPENGL_MODULE_DEPENDS QTGUI QTCORE)
123+
SET(QT_QTSCRIPT_MODULE_DEPENDS QTCORE)
124+
SET(QT_QTGUI_MODULE_DEPENDS QTCORE)
125+
SET(QT_QTTEST_MODULE_DEPENDS QTCORE)
126+
SET(QT_QTXML_MODULE_DEPENDS QTCORE)
127+
SET(QT_QTSQL_MODULE_DEPENDS QTCORE)
128+
SET(QT_QTNETWORK_MODULE_DEPENDS QTCORE)
129+
130+
# Qt modules (in order of dependence)
131+
FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN
132+
QAXSERVER QAXCONTAINER QTDECLARATIVE QTSCRIPT QTSVG QTUITOOLS QTHELP
133+
QTWEBKIT PHONON QTSCRIPTTOOLS QTMULTIMEDIA QTXMLPATTERNS QTGUI QTTEST
134+
QTDBUS QTXML QTSQL QTNETWORK QTCORE)
135+
136+
IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
137+
IF (QT_${module}_FOUND)
138+
IF(QT_USE_${module})
139+
STRING(REPLACE "QT" "" qt_module_def "${module}")
140+
ADD_DEFINITIONS(-DQT_${qt_module_def}_LIB)
141+
SET(QT_INCLUDE_DIRS ${QT_INCLUDE_DIRS} ${QT_${module}_INCLUDE_DIR})
142+
ENDIF(QT_USE_${module})
143+
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIBRARY})
144+
SET(QT_LIBRARIES_PLUGINS ${QT_LIBRARIES_PLUGINS} ${QT_${module}_PLUGINS})
145+
IF(QT_IS_STATIC)
146+
SET(QT_LIBRARIES ${QT_LIBRARIES} ${QT_${module}_LIB_DEPENDENCIES})
147+
ENDIF(QT_IS_STATIC)
148+
FOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
149+
SET(QT_USE_${depend_module}_DEPENDS 1)
150+
ENDFOREACH(depend_module ${QT_${module}_MODULE_DEPENDS})
151+
ELSE (QT_${module}_FOUND)
152+
MESSAGE("Qt ${module} library not found.")
153+
ENDIF (QT_${module}_FOUND)
154+
ENDIF (QT_USE_${module} OR QT_USE_${module}_DEPENDS)
155+
156+
ENDFOREACH(module)

0 commit comments

Comments
 (0)