port to 3.8

This commit is contained in:
Bastian Bloessl
2019-06-06 12:03:43 +02:00
parent 39861c37af
commit 9393abbf65
6 changed files with 122 additions and 36 deletions
+27 -4
View File
@@ -21,20 +21,20 @@ cmake_minimum_required(VERSION 3.8)
project(gr-ieee802-11 CXX C) project(gr-ieee802-11 CXX C)
enable_testing() enable_testing()
#install to PyBOMBS target prefix if defined # Install to PyBOMBS target prefix if defined
if(DEFINED ENV{PYBOMBS_PREFIX}) if(DEFINED ENV{PYBOMBS_PREFIX})
set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX}) set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX})
message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}") message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}")
endif() endif()
#select the release build type by default to get optimization flags # Select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build type not specified: defaulting to release.") message(STATUS "Build type not specified: defaulting to release.")
endif(NOT CMAKE_BUILD_TYPE) endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
#make sure our local CMake Modules path comes first # Make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
# Set the version information here # Set the version information here
@@ -45,6 +45,9 @@ set(VERSION_INFO_MAINT_VERSION 0)
cmake_policy(SET CMP0011 NEW) cmake_policy(SET CMP0011 NEW)
# Enable generation of compile_commands.json for code completion engines
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
######################################################################## ########################################################################
# Compiler specific setup # Compiler specific setup
######################################################################## ########################################################################
@@ -55,10 +58,30 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
add_definitions(-fvisibility=hidden) add_definitions(-fvisibility=hidden)
endif() endif()
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_STANDARD 11)
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_STANDARD 11)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_CXX_STANDARD 11)
ELSE()
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_C_STANDARD 11)
ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang")
SET(CMAKE_C_STANDARD 11)
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_C_STANDARD 11)
ELSE()
message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
######################################################################## ########################################################################
# Install directories # Install directories
######################################################################## ########################################################################
find_package(Gnuradio "3.8" REQUIRED COMPONENTS RUNTIME FILTER FFT PMT DIGITAL) find_package(Gnuradio "3.8" REQUIRED COMPONENTS filter fft digital analog blocks)
include(GrVersion) include(GrVersion)
include(GrPlatform) #define LIB_SUFFIX include(GrPlatform) #define LIB_SUFFIX
+30 -2
View File
@@ -1,3 +1,31 @@
file(GLOB xml_files "*.block.yml") # Copyright 2011 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# 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(FILES ${xml_files} DESTINATION share/gnuradio/grc/blocks ) install(FILES
ieee802_11_chunks_to_symbols.block.yml
ieee802_11_decode_mac.block.yml
ieee802_11_ether_encap.block.yml
ieee802_11_frame_equalizer.block.yml
ieee802_11_mac.block.yml
ieee802_11_mapper.block.yml
ieee802_11_parse_mac.block.yml
ieee802_11_sync_long.block.yml
ieee802_11_sync_short.block.yml DESTINATION share/gnuradio/grc/blocks
)
+3 -3
View File
@@ -35,7 +35,7 @@ list(APPEND include_sources
) )
install( install(
FILES ${include_sources} FILES ${include_sources}
DESTINATION ${GR_INCLUDE_DIR}/gnuradio/ieee802_11 DESTINATION ${GR_INCLUDE_DIR}/gnuradio/ieee802_11
COMPONENT "ieee802_11_devel" COMPONENT "ieee802_11_devel"
) )
+44 -13
View File
@@ -30,7 +30,7 @@ endif(SSE2_SUPPORTED)
######################################################################## ########################################################################
# Setup library # Setup library
######################################################################## ########################################################################
list(APPEND gr_ieee802_11_sources list(APPEND ieee802_11_sources
chunks_to_symbols_impl.cc chunks_to_symbols_impl.cc
constellations_impl.cc constellations_impl.cc
decode_mac.cc decode_mac.cc
@@ -53,29 +53,60 @@ list(APPEND gr_ieee802_11_sources
# use SSE2 optimized viterbi implementation if SSE2 is enabled # use SSE2 optimized viterbi implementation if SSE2 is enabled
if(SSE2_SUPPORTED) if(SSE2_SUPPORTED)
list(APPEND gr_ieee802_11_sources list(APPEND ieee802_11_sources
viterbi_decoder/viterbi_decoder_x86.cc viterbi_decoder/viterbi_decoder_x86.cc
) )
else() else()
list(APPEND gr_ieee802_11_sources list(APPEND ieee802_11_sources
viterbi_decoder/viterbi_decoder_generic.cc viterbi_decoder/viterbi_decoder_generic.cc
) )
endif(SSE2_SUPPORTED) endif(SSE2_SUPPORTED)
list(APPEND gr_ieee802_11_libs set(ieee802_11_sources "${ieee802_11_sources}" PARENT_SCOPE)
${Boost_LIBRARIES} if(NOT ieee802_11_sources)
${GNURADIO_ALL_LIBRARIES} MESSAGE(STATUS "No C++ sources... skipping lib/")
) return()
endif(NOT ieee802_11_sources)
add_library(gnuradio-ieee802_11 SHARED ${gr_ieee802_11_sources}) add_library(gnuradio-ieee802_11 SHARED ${ieee802_11_sources})
target_link_libraries(gnuradio-ieee802_11 ${gr_ieee802_11_libs}) target_link_libraries(gnuradio-ieee802_11
gnuradio::gnuradio-runtime
gnuradio::gnuradio-filter
gnuradio::gnuradio-blocks
gnuradio::gnuradio-analog
gnuradio::gnuradio-fft
gnuradio::gnuradio-digital)
target_include_directories(gnuradio-ieee802_11
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
PUBLIC $<INSTALL_INTERFACE:include>
)
set_target_properties(gnuradio-ieee802_11 PROPERTIES DEFINE_SYMBOL "gnuradio_ieee802_11_EXPORTS") set_target_properties(gnuradio-ieee802_11 PROPERTIES DEFINE_SYMBOL "gnuradio_ieee802_11_EXPORTS")
if(APPLE)
set_target_properties(gnuradio-ieee802_11 PROPERTIES
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)
endif(APPLE)
######################################################################## ########################################################################
# Install built library files # Install built library files
######################################################################## ########################################################################
install(TARGETS gnuradio-ieee802_11 include(GrMiscUtils)
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file GR_LIBRARY_FOO(gnuradio-ieee802_11)
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
RUNTIME DESTINATION bin # .dll file ########################################################################
# Print summary
########################################################################
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Building for version: ${VERSION} / ${LIBVER}")
########################################################################
# Build and register unit test
########################################################################
include(GrTest)
# If your unit tests require special include paths, add them here
#include_directories()
# List all files that contain Boost.UTF unit tests here
list(APPEND test_ieee802_11_sources
) )
+1 -1
View File
@@ -17,7 +17,7 @@
#ifndef INCLUDED_IEEE802_11_VITERBI_DECODER_BASE_H #ifndef INCLUDED_IEEE802_11_VITERBI_DECODER_BASE_H
#define INCLUDED_IEEE802_11_VITERBI_DECODER_BASE_H #define INCLUDED_IEEE802_11_VITERBI_DECODER_BASE_H
#include "utils.h" #include "../utils.h"
namespace gr { namespace gr {
namespace ieee802_11 { namespace ieee802_11 {
+17 -13
View File
@@ -15,31 +15,35 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
########################################################################
# Check if there is C++ code at all
########################################################################
if(NOT ieee802_11_sources)
MESSAGE(STATUS "No C++ sources... skipping swig/")
return()
endif(NOT ieee802_11_sources)
######################################################################## ########################################################################
# Include swig generation macros # Include swig generation macros
######################################################################## ########################################################################
find_package(SWIG) find_package(SWIG)
include(GrPython) find_package(PythonLibs)
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
return()
endif()
include(GrSwig) include(GrSwig)
include(GrPython)
set(GR_SWIG_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/../include/
${CMAKE_CURRENT_BINARY_DIR}/../include/
)
######################################################################## ########################################################################
# Setup swig generation # Setup swig generation
######################################################################## ########################################################################
foreach(incdir ${GNURADIO_RUNTIME_INCLUDE_DIRS}) set(GR_SWIG_INCLUDE_DIRS $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
list(APPEND GR_SWIG_INCLUDE_DIRS ${incdir}/gnuradio/swig) set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig)
endforeach(incdir)
set(GR_SWIG_LIBRARIES gnuradio-ieee802_11) set(GR_SWIG_LIBRARIES gnuradio-ieee802_11)
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/ieee802_11_swig_doc.i) set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/ieee802_11_swig_doc.i)
set(GR_SWIG_DOC_DIRS set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
${CMAKE_CURRENT_SOURCE_DIR}/../include/ieee802-11/
${CMAKE_CURRENT_BINARY_DIR}/../include/ieee802-11/
)
GR_SWIG_MAKE(ieee802_11_swig ieee802_11_swig.i) GR_SWIG_MAKE(ieee802_11_swig ieee802_11_swig.i)