Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gr-bladeRF-cdc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ELEN90089 CDC
gr-bladeRF-cdc
Commits
a6567ecc
Commit
a6567ecc
authored
Jun 1, 2021
by
Sergey Musikhin
Browse files
Options
Downloads
Patches
Plain Diff
fix CMakeLista for correct python import
parent
847b2311
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+60
-0
60 additions, 0 deletions
CMakeLists.txt
lib/CMakeLists.txt
+82
-12
82 additions, 12 deletions
lib/CMakeLists.txt
lib/bladerf/CMakeLists.txt
+2
-2
2 additions, 2 deletions
lib/bladerf/CMakeLists.txt
python/bindings/CMakeLists.txt
+2
-2
2 additions, 2 deletions
python/bindings/CMakeLists.txt
with
146 additions
and
16 deletions
CMakeLists.txt
+
60
−
0
View file @
a6567ecc
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
########################################################################
########################################################################
cmake_minimum_required
(
VERSION 3.8
)
cmake_minimum_required
(
VERSION 3.8
)
project
(
gr-bladeRF CXX C
)
project
(
gr-bladeRF CXX C
)
include
(
GNUInstallDirs
)
enable_testing
()
enable_testing
()
# Install to PyBOMBS target prefix if defined
# Install to PyBOMBS target prefix if defined
...
@@ -48,6 +49,7 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
...
@@ -48,6 +49,7 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
AND NOT WIN32
)
AND NOT WIN32
)
#http://gcc.gnu.org/wiki/Visibility
#http://gcc.gnu.org/wiki/Visibility
add_definitions
(
-fvisibility=hidden
)
add_definitions
(
-fvisibility=hidden
)
add_definitions
(
-fvisibility-inlines-hidden
)
endif
()
endif
()
IF
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
IF
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
...
@@ -70,6 +72,57 @@ ELSE()
...
@@ -70,6 +72,57 @@ ELSE()
message
(
WARNING
"C standard could not be set because compiler is not GNU, Clang or MSVC."
)
message
(
WARNING
"C standard could not be set because compiler is not GNU, Clang or MSVC."
)
ENDIF
()
ENDIF
()
# Misc options
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
add_definitions
(
-Wall
)
add_definitions
(
-Wextra
)
add_definitions
(
-Wno-unused-parameter
)
add_definitions
(
-Wsign-compare
)
#add_definitions(-Wconversion)
#add_definitions(-pedantic)
#add_definitions(-ansi)
endif
()
# SIMD
if
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"x86_64|AMD64|x86"
)
set
(
USE_SIMD
"SSE2"
CACHE STRING
"Use SIMD instructions"
)
else
()
set
(
USE_SIMD
"no"
CACHE STRING
"Use SIMD instructions"
)
endif
()
set
(
USE_SIMD_VALUES
"no"
"SSE2"
"AVX"
)
set_property
(
CACHE USE_SIMD PROPERTY STRINGS
${
USE_SIMD_VALUES
}
)
list
(
FIND USE_SIMD_VALUES
${
USE_SIMD
}
USE_SIMD_INDEX
)
if
(
${
USE_SIMD_INDEX
}
EQUAL -1
)
message
(
FATAL_ERROR
"Option
${
USE_SIMD
}
not supported, valid entries are
${
USE_SIMD_VALUES
}
"
)
endif
()
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
OR
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
)
if
(
USE_SIMD MATCHES SSE2
)
add_definitions
(
-msse2
)
add_definitions
(
-DUSE_SSE2
)
endif
()
if
(
USE_SIMD MATCHES AVX
)
add_definitions
(
-march=native
)
add_definitions
(
-DUSE_AVX
)
endif
()
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
if
(
USE_SIMD MATCHES SSE2
)
add_definitions
(
/arch:SSE2
)
add_definitions
(
-DUSE_SSE2
)
endif
()
if
(
USE_SIMD MATCHES AVX
)
add_definitions
(
/arch:AVX
)
add_definitions
(
-DUSE_AVX
)
endif
()
# boost feels like using lib pragmas to link to libs,
# but the boost libs might not even be in the (default) lib search path
add_definitions
(
-DBOOST_ALL_NO_LIB
)
# macro turns std::min into errors...
add_definitions
(
-DNOMINMAX
)
endif
()
########################################################################
########################################################################
# Install directories
# Install directories
########################################################################
########################################################################
...
@@ -81,6 +134,9 @@ include(GrVersion)
...
@@ -81,6 +134,9 @@ include(GrVersion)
include
(
GrPlatform
)
#define LIB_SUFFIX
include
(
GrPlatform
)
#define LIB_SUFFIX
include
(
GrComponent
)
if
(
NOT CMAKE_MODULES_DIR
)
if
(
NOT CMAKE_MODULES_DIR
)
set
(
CMAKE_MODULES_DIR lib
${
LIB_SUFFIX
}
/cmake
)
set
(
CMAKE_MODULES_DIR lib
${
LIB_SUFFIX
}
/cmake
)
endif
(
NOT CMAKE_MODULES_DIR
)
endif
(
NOT CMAKE_MODULES_DIR
)
...
@@ -112,6 +168,10 @@ if(APPLE)
...
@@ -112,6 +168,10 @@ if(APPLE)
endif
(
NOT CMAKE_BUILD_WITH_INSTALL_RPATH
)
endif
(
NOT CMAKE_BUILD_WITH_INSTALL_RPATH
)
endif
(
APPLE
)
endif
(
APPLE
)
########################################################################
# Hardware
########################################################################
find_package
(
LibbladeRF
)
########################################################################
########################################################################
# Find gnuradio build dependencies
# Find gnuradio build dependencies
########################################################################
########################################################################
...
...
This diff is collapsed.
Click to expand it.
lib/CMakeLists.txt
+
82
−
12
View file @
a6567ecc
...
@@ -10,16 +10,16 @@
...
@@ -10,16 +10,16 @@
# Setup library
# Setup library
########################################################################
########################################################################
include
(
GrPlatform
)
#define LIB_SUFFIX
include
(
GrPlatform
)
#define LIB_SUFFIX
list
(
APPEND blade
RF_sou
rc
e
s
list
(
APPEND
gr_
blade
rf_s
rcs
source_impl.cc
source_impl.cc
sink_impl.cc
sink_impl.cc
)
)
set
(
bladeRF_sources
"
${
bladeRF_sources
}
"
PARENT_SCOPE
)
#-pthread Adds support for multithreading with the pthreads library.
if
(
NOT bladeRF_sources
)
#This option sets flags for both the preprocessor and linker. (man gcc
)
MESSAGE
(
STATUS
"No C++ sources... skipping lib/"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
return
(
)
list
(
APPEND Boost_LIBRARIES -pthread
)
endif
(
NOT bladeRF_sources
)
endif
()
MACRO
(
APPEND_LIB_LIST
)
MACRO
(
APPEND_LIB_LIST
)
SET
(
gr_bladerf_libs
"
${
gr_bladerf_libs
}
;
${
ARGN
}
"
CACHE INTERNAL
"lib list"
)
SET
(
gr_bladerf_libs
"
${
gr_bladerf_libs
}
;
${
ARGN
}
"
CACHE INTERNAL
"lib list"
)
...
@@ -27,11 +27,8 @@ ENDMACRO(APPEND_LIB_LIST)
...
@@ -27,11 +27,8 @@ ENDMACRO(APPEND_LIB_LIST)
set
(
gr_bladerf_libs
""
CACHE INTERNAL
"lib that accumulates link targets"
)
set
(
gr_bladerf_libs
""
CACHE INTERNAL
"lib that accumulates link targets"
)
APPEND_LIB_LIST
(
gnuradio::gnuradio-runtime
)
add_library
(
gnuradio-bladeRF SHARED
)
APPEND_LIB_LIST
(
${
Boost_LIBRARIES
}
gnuradio::gnuradio-runtime
)
add_library
(
gnuradio-bladeRF SHARED
${
bladeRF_sources
}
)
target_link_libraries
(
gnuradio-bladeRF
${
gr_bladerf_libs
}
)
target_include_directories
(
gnuradio-bladeRF
target_include_directories
(
gnuradio-bladeRF
PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
PRIVATE
${
CMAKE_CURRENT_SOURCE_DIR
}
PUBLIC
${
Boost_INCLUDE_DIRS
}
PUBLIC
${
Boost_INCLUDE_DIRS
}
...
@@ -46,7 +43,80 @@ if(APPLE)
...
@@ -46,7 +43,80 @@ if(APPLE)
)
)
endif
(
APPLE
)
endif
(
APPLE
)
########################################################################
# Setup defines for high resolution timing
########################################################################
message
(
STATUS
""
)
message
(
STATUS
"Configuring high resolution timing..."
)
include
(
CheckCXXSourceCompiles
)
set
(
CMAKE_REQUIRED_LIBRARIES -lrt
)
CHECK_CXX_SOURCE_COMPILES
(
"
#include <ctime>
int main(){
timespec ts;
return clock_gettime(CLOCK_MONOTONIC, &ts);
}
"
HAVE_CLOCK_GETTIME
)
unset
(
CMAKE_REQUIRED_LIBRARIES
)
include
(
CheckCXXSourceCompiles
)
CHECK_CXX_SOURCE_COMPILES
(
"
#include <mach/mach_time.h>
int main(){
mach_timebase_info_data_t info;
mach_timebase_info(&info);
mach_absolute_time();
return 0;
}
"
HAVE_MACH_ABSOLUTE_TIME
)
CHECK_CXX_SOURCE_COMPILES
(
"
#include <Windows.h>
int main(){
LARGE_INTEGER value;
QueryPerformanceCounter(&value);
QueryPerformanceFrequency(&value);
return 0;
}
"
HAVE_QUERY_PERFORMANCE_COUNTER
)
if
(
HAVE_CLOCK_GETTIME
)
message
(
STATUS
" High resolution timing supported through clock_gettime."
)
set
(
TIME_SPEC_DEFS HAVE_CLOCK_GETTIME
)
APPEND_LIB_LIST
(
"-lrt"
)
elseif
(
HAVE_MACH_ABSOLUTE_TIME
)
message
(
STATUS
" High resolution timing supported through mach_absolute_time."
)
set
(
TIME_SPEC_DEFS HAVE_MACH_ABSOLUTE_TIME
)
elseif
(
HAVE_QUERY_PERFORMANCE_COUNTER
)
message
(
STATUS
" High resolution timing supported through QueryPerformanceCounter."
)
set
(
TIME_SPEC_DEFS HAVE_QUERY_PERFORMANCE_COUNTER
)
else
()
message
(
STATUS
" High resolution timing supported through microsec_clock."
)
set
(
TIME_SPEC_DEFS HAVE_MICROSEC_CLOCK
)
endif
()
set_source_files_properties
(
time_spec.cc
PROPERTIES COMPILE_DEFINITIONS
"
${
TIME_SPEC_DEFS
}
"
)
########################################################################
# Setup bladeRF component
########################################################################
GR_REGISTER_COMPONENT
(
"nuand bladeRF"
ENABLE_BLADERF LIBBLADERF_FOUND
)
if
(
ENABLE_BLADERF
)
add_subdirectory
(
bladerf
)
add_subdirectory
(
bladerf
)
endif
(
ENABLE_BLADERF
)
########################################################################
# Finalize target
########################################################################
set_target_properties
(
gnuradio-bladeRF PROPERTIES SOURCES
"
${
gr_bladerf_srcs
}
"
)
target_link_libraries
(
gnuradio-bladeRF
${
gr_bladerf_libs
}
)
########################################################################
########################################################################
...
...
This diff is collapsed.
Click to expand it.
lib/bladerf/CMakeLists.txt
+
2
−
2
View file @
a6567ecc
...
@@ -31,9 +31,9 @@ APPEND_LIB_LIST(
...
@@ -31,9 +31,9 @@ APPEND_LIB_LIST(
${
Volk_LIBRARIES
}
${
Volk_LIBRARIES
}
)
)
list
(
APPEND blade
RF_sou
rc
e
s
list
(
APPEND
gr_
blade
rf_s
rcs
${
CMAKE_CURRENT_SOURCE_DIR
}
/bladerf_source_c.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/bladerf_source_c.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/bladerf_sink_c.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/bladerf_sink_c.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/bladerf_common.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/bladerf_common.cc
)
)
set
(
blade
RF_sou
rc
e
s
${
blade
RF_sou
rc
e
s
}
PARENT_SCOPE
)
set
(
gr_
blade
rf_s
rcs
${
gr_
blade
rf_s
rcs
}
PARENT_SCOPE
)
This diff is collapsed.
Click to expand it.
python/bindings/CMakeLists.txt
+
2
−
2
View file @
a6567ecc
...
@@ -8,10 +8,10 @@
...
@@ -8,10 +8,10 @@
########################################################################
########################################################################
# Check if there is C++ code at all
# Check if there is C++ code at all
########################################################################
########################################################################
if
(
NOT blade
RF_sou
rc
e
s
)
if
(
NOT
gr_
blade
rf_s
rcs
)
MESSAGE
(
STATUS
"No C++ sources... skipping python bindings"
)
MESSAGE
(
STATUS
"No C++ sources... skipping python bindings"
)
return
()
return
()
endif
(
NOT blade
RF_sou
rc
e
s
)
endif
(
NOT
gr_
blade
rf_s
rcs
)
########################################################################
########################################################################
# Check for pygccxml
# Check for pygccxml
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment