Skip to content

Commit 0208fd3

Browse files
committed
updates
1 parent 04e089d commit 0208fd3

15 files changed

+77
-62
lines changed

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
*.pyc
2+
__pycache__
3+
/build
4+
.cmake
5+
CMakeCache.txt
6+
CMakeFiles
7+
.ninja_deps
8+
.ninja_log
9+
/Testing
10+
CTestTestfile.cmake
11+
cmake_install.cmake
12+
cmake_uninstall.cmake
13+
build.ninja
14+
python_compile_helper.py
15+
get_swig_deps.py
16+
*.i
17+
/lib/test_fsk4_test.sh
18+
/swig/_fsk4_swig_swig_tag.cpp
19+
*.cpp.in

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
########################################################################
2121
# Project setup
2222
########################################################################
23-
cmake_minimum_required(VERSION 2.6)
23+
cmake_minimum_required(VERSION 3.0)
2424
project(gr-fsk4 CXX C)
2525
enable_testing()
2626

@@ -67,6 +67,7 @@ endif()
6767
# Install directories
6868
########################################################################
6969
include(GrPlatform) #define LIB_SUFFIX
70+
include(GrMiscUtils)
7071
set(GR_RUNTIME_DIR bin)
7172
set(GR_LIBRARY_DIR lib${LIB_SUFFIX})
7273
set(GR_INCLUDE_DIR include/fsk4)
@@ -103,7 +104,7 @@ endif(APPLE)
103104
########################################################################
104105
# Find gnuradio build dependencies
105106
########################################################################
106-
find_package(CppUnit)
107+
find_package(CPPUNIT)
107108
find_package(Doxygen)
108109

109110
# Search for GNU Radio and its components and versions. Add any

cmake/Modules/FindCppUnit.cmake cmake/Modules/FindCPPUNIT.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
1010
# CPPUNIT_FOUND, If false, do not try to use CppUnit.
1111

12-
INCLUDE(FindPkgConfig)
12+
if(NOT PKG_CONFIG_FOUND)
13+
INCLUDE(FindPkgConfig)
14+
endif()
1315
PKG_CHECK_MODULES(PC_CPPUNIT "cppunit")
1416

1517
FIND_PATH(CPPUNIT_INCLUDE_DIRS

cmake/Modules/GrMiscUtils.cmake

+24-28
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,30 @@
1717
# the Free Software Foundation, Inc., 51 Franklin Street,
1818
# Boston, MA 02110-1301, USA.
1919

20-
if(DEFINED __INCLUDED_GR_MISC_UTILS_CMAKE)
21-
return()
22-
endif()
23-
set(__INCLUDED_GR_MISC_UTILS_CMAKE TRUE)
20+
21+
########################################################################
22+
# Generates the .la libtool file
23+
# This appears to generate libtool files that cannot be used by auto*.
24+
# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest])
25+
# Notice: there is not COMPONENT option, these will not get distributed.
26+
########################################################################
27+
function(GR_LIBTOOL)
28+
if(NOT DEFINED GENERATE_LIBTOOL)
29+
set(GENERATE_LIBTOOL OFF) #disabled by default
30+
endif()
31+
32+
if(GENERATE_LIBTOOL)
33+
include(CMakeParseArgumentsCopy)
34+
CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN})
35+
36+
find_program(LIBTOOL libtool)
37+
if(LIBTOOL)
38+
include(CMakeMacroLibtoolFile)
39+
CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION})
40+
endif(LIBTOOL)
41+
endif(GENERATE_LIBTOOL)
42+
43+
endfunction(GR_LIBTOOL)
2444

2545
########################################################################
2646
# Set global variable macro.
@@ -104,30 +124,6 @@ macro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
104124
endif(${have})
105125
endmacro(GR_ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
106126

107-
########################################################################
108-
# Generates the .la libtool file
109-
# This appears to generate libtool files that cannot be used by auto*.
110-
# Usage GR_LIBTOOL(TARGET [target] DESTINATION [dest])
111-
# Notice: there is not COMPONENT option, these will not get distributed.
112-
########################################################################
113-
function(GR_LIBTOOL)
114-
if(NOT DEFINED GENERATE_LIBTOOL)
115-
set(GENERATE_LIBTOOL OFF) #disabled by default
116-
endif()
117-
118-
if(GENERATE_LIBTOOL)
119-
include(CMakeParseArgumentsCopy)
120-
CMAKE_PARSE_ARGUMENTS(GR_LIBTOOL "" "TARGET;DESTINATION" "" ${ARGN})
121-
122-
find_program(LIBTOOL libtool)
123-
if(LIBTOOL)
124-
include(CMakeMacroLibtoolFile)
125-
CREATE_LIBTOOL_FILE(${GR_LIBTOOL_TARGET} /${GR_LIBTOOL_DESTINATION})
126-
endif(LIBTOOL)
127-
endif(GENERATE_LIBTOOL)
128-
129-
endfunction(GR_LIBTOOL)
130-
131127
########################################################################
132128
# Do standard things to the library target
133129
# - set target properties

cmake/Modules/GrPython.cmake

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ if(PYTHON_EXECUTABLE)
3636
else(PYTHON_EXECUTABLE)
3737

3838
#use the built-in find script
39-
find_package(PythonInterp 2)
39+
find_package(PythonInterp 3)
4040

4141
#and if that fails use the find program routine
4242
if(NOT PYTHONINTERP_FOUND)
43-
find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python2.6 python2.5)
43+
find_program(PYTHON_EXECUTABLE NAMES python python3 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5)
4444
if(PYTHON_EXECUTABLE)
4545
set(PYTHONINTERP_FOUND TRUE)
4646
endif(PYTHON_EXECUTABLE)
@@ -49,7 +49,7 @@ else(PYTHON_EXECUTABLE)
4949
endif(PYTHON_EXECUTABLE)
5050

5151
if (CMAKE_CROSSCOMPILING)
52-
set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
52+
set(QA_PYTHON_EXECUTABLE "/usr/bin/python3")
5353
else (CMAKE_CROSSCOMPILING)
5454
set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
5555
endif(CMAKE_CROSSCOMPILING)
@@ -119,7 +119,7 @@ file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
119119
function(GR_UNIQUE_TARGET desc)
120120
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
121121
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
122-
unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
122+
unique = hashlib.md5('${reldir}${ARGN}'.encode('ascii')).hexdigest()[:5]
123123
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
124124
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
125125
add_custom_target(${_target} ALL DEPENDS ${ARGN})
@@ -191,7 +191,7 @@ function(GR_PYTHON_INSTALL)
191191
file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native)
192192

193193
if (CMAKE_CROSSCOMPILING)
194-
set(pyexe_native "/usr/bin/env python")
194+
set(pyexe_native "/usr/bin/env python3")
195195
endif()
196196

197197
foreach(pyfile ${GR_PYTHON_INSTALL_PROGRAMS})

cmake/Modules/GrSwig.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ function(GR_SWIG_MAKE_DOCS output_file)
6161
@ONLY)
6262

6363
#Create a dummy custom command that depends on other targets
64-
include(GrMiscUtils)
6564
GR_GEN_TARGET_DEPS(_${name}_tag tag_deps ${GR_SWIG_DOCS_TARGET_DEPS})
6665

6766
#call doxygen on the Doxyfile + input headers
@@ -127,7 +126,7 @@ macro(GR_SWIG_MAKE name)
127126
endif()
128127

129128
#append additional include directories
130-
find_package(PythonLibs 2)
129+
find_package(PythonLibs 3)
131130
list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_PATH}) #deprecated name (now dirs)
132131
list(APPEND GR_SWIG_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
133132

@@ -203,6 +202,7 @@ macro(GR_SWIG_INSTALL)
203202
COMPONENT ${GR_SWIG_INSTALL_COMPONENT}
204203
)
205204

205+
include(GrMiscUtils)
206206
GR_LIBTOOL(
207207
TARGET ${SWIG_MODULE_${name}_REAL_NAME}
208208
DESTINATION ${GR_SWIG_INSTALL_DESTINATION}

cmake/Modules/UseSWIG.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
175175
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
176176
execute_process(
177177
COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
178-
unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
178+
unique = hashlib.md5('${reldir}${ARGN}'.encode('ascii')).hexdigest()[:5]
179179
print(re.sub('\\W', '_', '${name} ${reldir} ' + unique))"
180180
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE
181181
)
@@ -253,7 +253,7 @@ macro(SWIG_ADD_MODULE name language)
253253

254254
set(swig_generated_sources)
255255
foreach(it ${swig_dot_i_sources})
256-
SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it})
256+
SWIG_ADD_SOURCE_TO_MODULE("${name}" swig_generated_source "${it}")
257257
set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
258258
endforeach()
259259
get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)

include/fsk4/apco25_f.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace gr {
3838
class FSK4_API apco25_f : virtual public gr::block
3939
{
4040
public:
41-
typedef boost::shared_ptr<apco25_f> sptr;
41+
typedef std::shared_ptr<apco25_f> sptr;
4242

4343
/*!
4444
* \brief Return a shared_ptr to a new instance of fsk4::apco25_f.

include/fsk4/demod_ff.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace gr {
3838
class FSK4_API demod_ff : virtual public gr::block
3939
{
4040
public:
41-
typedef boost::shared_ptr<demod_ff> sptr;
41+
typedef std::shared_ptr<demod_ff> sptr;
4242

4343
/*!
4444
* \brief Return a shared_ptr to a new instance of fsk4::demod_ff.

include/fsk4/generic_f.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace gr {
3838
class FSK4_API generic_f : virtual public gr::block
3939
{
4040
public:
41-
typedef boost::shared_ptr<generic_f> sptr;
41+
typedef std::shared_ptr<generic_f> sptr;
4242

4343
/*!
4444
* \brief Return a shared_ptr to a new instance of fsk4::generic_f.

include/fsk4/rdlap_f.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
#include <gnuradio/msg_queue.h>
2828
#include <gnuradio/message.h>
2929

30-
namespace gr {
31-
namespace fsk4 {
30+
namespace gr::fsk4 {
3231

3332
/*!
3433
* \brief <+description of block+>
@@ -38,7 +37,7 @@ namespace gr {
3837
class FSK4_API rdlap_f : virtual public gr::block
3938
{
4039
public:
41-
typedef boost::shared_ptr<rdlap_f> sptr;
40+
typedef std::shared_ptr<rdlap_f> sptr;
4241

4342
/*!
4443
* \brief Return a shared_ptr to a new instance of fsk4::rdlap_f.
@@ -51,8 +50,7 @@ namespace gr {
5150
static sptr make(gr::msg_queue::sptr queue, int processing_flags);
5251
};
5352

54-
} // namespace fsk4
55-
} // namespace gr
53+
} // namespace gr
5654

5755
#endif /* INCLUDED_FSK4_RDLAP_F_H */
5856

lib/apco25_f_impl.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
#include <gnuradio/io_signature.h>
2626
#include "apco25_f_impl.h"
2727

28-
namespace gr {
29-
namespace fsk4 {
28+
namespace gr::fsk4 {
3029

3130
apco25_f::sptr
3231
apco25_f::make(gr::msg_queue::sptr queue, int processing_flags)
@@ -244,6 +243,5 @@ namespace gr {
244243
return 0;
245244
}
246245

247-
} /* namespace fsk4 */
248-
} /* namespace gr */
246+
} /* namespace gr */
249247

lib/generic_f_impl.cc

+8-9
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
#endif
2424

2525
#include <gnuradio/io_signature.h>
26+
27+
#include <utility>
2628
#include "generic_f_impl.h"
2729

28-
namespace gr {
29-
namespace fsk4 {
30+
namespace gr::fsk4 {
3031

3132
generic_f::sptr
3233
generic_f::make(gr::msg_queue::sptr queue, int processing_flags)
3334
{
34-
return gnuradio::get_initial_sptr
35-
(new generic_f_impl(queue, processing_flags));
35+
return gnuradio::get_initial_sptr(new generic_f_impl(queue, processing_flags));
3636
}
3737

3838
/*
@@ -42,7 +42,7 @@ namespace gr {
4242
: gr::block("generic_f",
4343
gr::io_signature::make(1, 1, sizeof(float)),
4444
gr::io_signature::make(0, 0, 0)),
45-
d_queue(queue)
45+
d_queue(std::move(queue))
4646
{
4747
sym_counter = 0;
4848

@@ -80,8 +80,8 @@ namespace gr {
8080
{
8181
unsigned char sym;
8282

83-
const float *in = (const float *) input_items[0];
84-
float *out = (float *) output_items[0];
83+
const auto *in = (const float *) input_items[0];
84+
auto *out = (float *) output_items[0];
8585

8686
// Do <+signal processing+>
8787
// run through all provided data;
@@ -115,6 +115,5 @@ namespace gr {
115115
return 0;
116116
}
117117

118-
} /* namespace fsk4 */
119-
} /* namespace gr */
118+
} /* namespace gr */
120119

python/__init__.pyc

-355 Bytes
Binary file not shown.

swig/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ endif(NOT fsk4_sources)
2929
# Include swig generation macros
3030
########################################################################
3131
find_package(SWIG)
32-
find_package(PythonLibs 2)
32+
find_package(PythonLibs 3)
3333
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
3434
return()
3535
endif()
36+
3637
include(GrSwig)
3738
include(GrPython)
39+
include(GrMiscUtils)
3840

3941
########################################################################
4042
# Setup swig generation

0 commit comments

Comments
 (0)