mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-10 14:23:27 -05:00
Soapy bundle option; requires SoapySDR/loader_work
This commit is contained in:
parent
798c558c09
commit
a1b73403a7
@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8)
|
|||||||
|
|
||||||
SET(CUBICSDR_VERSION_MAJOR "0")
|
SET(CUBICSDR_VERSION_MAJOR "0")
|
||||||
SET(CUBICSDR_VERSION_MINOR "1")
|
SET(CUBICSDR_VERSION_MINOR "1")
|
||||||
SET(CUBICSDR_VERSION_PATCH "14")
|
SET(CUBICSDR_VERSION_PATCH "15")
|
||||||
SET(CUBICSDR_VERSION_REL "alpha")
|
SET(CUBICSDR_VERSION_REL "alpha")
|
||||||
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")
|
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")
|
||||||
|
|
||||||
@ -35,6 +35,22 @@ macro(configure_files srcDir destDir globStr)
|
|||||||
endforeach(templateFile)
|
endforeach(templateFile)
|
||||||
endmacro(configure_files)
|
endmacro(configure_files)
|
||||||
|
|
||||||
|
macro(configure_install_files srcDir destDir globStr)
|
||||||
|
message(STATUS "Copying ${srcDir}/${globStr} to directory ${destDir}")
|
||||||
|
make_directory(${destDir})
|
||||||
|
|
||||||
|
file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/${globStr})
|
||||||
|
foreach(templateFile ${templateFiles})
|
||||||
|
set(srcTemplatePath ${srcDir}/${templateFile})
|
||||||
|
message(STATUS "Configuring file ${templateFile}")
|
||||||
|
if(NOT IS_DIRECTORY ${srcTemplatePath})
|
||||||
|
configure_file(
|
||||||
|
${srcTemplatePath}
|
||||||
|
${destDir}/${templateFile}
|
||||||
|
COPYONLY)
|
||||||
|
endif(NOT IS_DIRECTORY ${srcTemplatePath})
|
||||||
|
endforeach(templateFile)
|
||||||
|
endmacro(configure_files)
|
||||||
|
|
||||||
macro(configure_files_recurse srcDir destDir)
|
macro(configure_files_recurse srcDir destDir)
|
||||||
message(STATUS "Configuring directory ${destDir}")
|
message(STATUS "Configuring directory ${destDir}")
|
||||||
@ -396,7 +412,8 @@ IF (NOT BUNDLE_APP)
|
|||||||
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.png")
|
configure_files(${PROJECT_SOURCE_DIR}/font ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.png")
|
||||||
configure_files(${PROJECT_SOURCE_DIR}/icon ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} CubicSDR.ico)
|
configure_files(${PROJECT_SOURCE_DIR}/icon ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} CubicSDR.ico)
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
configure_files(${PROJECT_SOURCE_DIR}/external/fftw-3.3.4/${EX_PLATFORM}/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} libfftw3f-3.dll)
|
configure_files(${SOAPY_SDR_ROOT}/bin/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME} "*.dll")
|
||||||
|
configure_files(${SOAPY_SDR_ROOT}/lib/SoapySDR/modules/ ${CMAKE_BINARY_DIR}/${EX_PLATFORM_NAME}/modules/ "*.dll")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
add_executable(CubicSDR ${cubicsdr_sources} ${cubicsdr_headers} ${RES_FILES})
|
add_executable(CubicSDR ${cubicsdr_sources} ${cubicsdr_headers} ${RES_FILES})
|
||||||
target_link_libraries(CubicSDR ${LIQUID_LIB} ${FFTW_LIB} ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${OTHER_LIBRARIES})
|
target_link_libraries(CubicSDR ${LIQUID_LIB} ${FFTW_LIB} ${wxWidgets_LIBRARIES} ${OPENGL_LIBRARIES} ${OTHER_LIBRARIES})
|
||||||
@ -500,6 +517,8 @@ IF (APPLE AND BUNDLE_APP)
|
|||||||
ENDIF (APPLE AND BUNDLE_APP)
|
ENDIF (APPLE AND BUNDLE_APP)
|
||||||
|
|
||||||
IF (WIN32 AND BUILD_INSTALLER)
|
IF (WIN32 AND BUILD_INSTALLER)
|
||||||
|
set(BUNDLE_SOAPY_MODS OFF CACHE BOOL "Bundle local SoapySDR modules")
|
||||||
|
|
||||||
set(CPACK_GENERATOR NSIS)
|
set(CPACK_GENERATOR NSIS)
|
||||||
set(CPACK_PACKAGE_NAME "CubicSDR")
|
set(CPACK_PACKAGE_NAME "CubicSDR")
|
||||||
set(CPACK_PACKAGE_VENDOR "cubicsdr.com")
|
set(CPACK_PACKAGE_VENDOR "cubicsdr.com")
|
||||||
@ -522,6 +541,7 @@ IF (WIN32 AND BUILD_INSTALLER)
|
|||||||
|
|
||||||
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
|
||||||
install(TARGETS CubicSDR RUNTIME DESTINATION .)
|
install(TARGETS CubicSDR RUNTIME DESTINATION .)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||||
@ -537,24 +557,24 @@ IF (WIN32 AND BUILD_INSTALLER)
|
|||||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
|
||||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.ico
|
${PROJECT_SOURCE_DIR}/icon/CubicSDR.ico
|
||||||
${PROJECT_SOURCE_DIR}/external/fftw-3.3.4/${EX_PLATFORM}/libfftw3f-3.dll
|
${PROJECT_SOURCE_DIR}/external/fftw-3.3.4/${EX_PLATFORM}/libfftw3f-3.dll
|
||||||
|
${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.dll
|
||||||
DESTINATION .)
|
DESTINATION .)
|
||||||
IF (MSVC)
|
|
||||||
install(FILES
|
IF (BUNDLE_SOAPY_MODS)
|
||||||
# ${PROJECT_SOURCE_DIR}/external/liquid-dsp/msvc/${EX_PLATFORM}/libliquid.dll
|
ADD_DEFINITIONS(
|
||||||
# ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release/msvc/${EX_PLATFORM}/libusb-1.0.dll
|
-DBUNDLE_SOAPY_MODS=1
|
||||||
${OTHER_INSTALL_FILES}
|
)
|
||||||
DESTINATION .)
|
file(GLOB SOAPY_BINS ${SOAPY_SDR_ROOT}/bin/*.dll)
|
||||||
ELSE (MSVC)
|
file(GLOB SOAPY_MODS ${SOAPY_SDR_ROOT}/lib/SoapySDR/modules/*.dll)
|
||||||
install(FILES
|
message(STATUS "SOAPY_BINS: ${SOAPY_BINS}")
|
||||||
# ${PROJECT_SOURCE_DIR}/external/liquid-dsp/gcc/${EX_PLATFORM}/libliquid.dll
|
message(STATUS "SOAPY_MODS: ${SOAPY_MODS}")
|
||||||
# ${PROJECT_SOURCE_DIR}/external/rtl-sdr-release/gcc/${EX_PLATFORM}/libusb-1.0.dll
|
install(FILES ${SOAPY_BINS} DESTINATION .)
|
||||||
${OTHER_INSTALL_FILES}
|
install(FILES ${SOAPY_MODS} DESTINATION modules)
|
||||||
DESTINATION .)
|
ENDIF(BUNDLE_SOAPY_MODS)
|
||||||
ENDIF(MSVC)
|
|
||||||
|
|
||||||
IF(MSVC AND EX_PLATFORM EQUAL 32)
|
IF(MSVC AND EX_PLATFORM EQUAL 32)
|
||||||
install(FILES
|
install(FILES
|
||||||
# ${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/libgcc_s_dw2-1.dll
|
${PROJECT_SOURCE_DIR}/external/msvc/${EX_PLATFORM_NAME}/libgcc_s_dw2-1.dll
|
||||||
DESTINATION .)
|
DESTINATION .)
|
||||||
ENDIF(MSVC AND EX_PLATFORM EQUAL 32)
|
ENDIF(MSVC AND EX_PLATFORM EQUAL 32)
|
||||||
|
|
||||||
|
@ -46,7 +46,19 @@ std::vector<SDRDeviceInfo *> *SDREnumerator::enumerate_devices(std::string remot
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "\tLoading modules... " << std::flush;
|
std::cout << "\tLoading modules... " << std::flush;
|
||||||
|
#ifdef BUNDLE_SOAPY_MODS
|
||||||
|
wxFileName exePath = wxFileName(wxStandardPaths::Get().GetExecutablePath());
|
||||||
|
std::vector<std::string> localMods = SoapySDR::listModules(exePath.GetPath().ToStdString() + "/modules/");
|
||||||
|
for (std::vector<std::string>::iterator mods_i = localMods.begin(); mods_i != localMods.end(); mods_i++) {
|
||||||
|
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Initializing bundled SoapySDR module " + (*mods_i) + "..");
|
||||||
|
SoapySDR::loadModule(*mods_i);
|
||||||
|
}
|
||||||
|
wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, "Loading SoapySDR modules..");
|
||||||
|
|
||||||
SoapySDR::loadModules();
|
SoapySDR::loadModules();
|
||||||
|
#else
|
||||||
|
SoapySDR::loadModules();
|
||||||
|
#endif
|
||||||
std::cout << "done" << std::endl;
|
std::cout << "done" << std::endl;
|
||||||
|
|
||||||
if (SDREnumerator::factories.size()) {
|
if (SDREnumerator::factories.size()) {
|
||||||
|
@ -81,7 +81,7 @@ void SDRThread::init() {
|
|||||||
if (chan->hasHardwareDC()) {
|
if (chan->hasHardwareDC()) {
|
||||||
hasHardwareDC.store(true);
|
hasHardwareDC.store(true);
|
||||||
// wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Found hardware DC offset correction support, internal disabled."));
|
// wxGetApp().sdrEnumThreadNotify(SDREnumerator::SDR_ENUM_MESSAGE, std::string("Found hardware DC offset correction support, internal disabled."));
|
||||||
device->setDCOffsetMode(SOAPY_SDR_RX, chan->getChannel(), true);
|
device->setDCOffsetMode(SOAPY_SDR_RX, chan->getChannel(), false);
|
||||||
} else {
|
} else {
|
||||||
hasHardwareDC.store(false);
|
hasHardwareDC.store(false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user