diff --git a/cmake/Modules/FindSerialDV.cmake b/cmake/Modules/FindSerialDV.cmake index 97fe530ec..c23e3d008 100644 --- a/cmake/Modules/FindSerialDV.cmake +++ b/cmake/Modules/FindSerialDV.cmake @@ -1,6 +1,6 @@ # Find serialDV -find_path(LIBSERIALDV_INCLUDE_DIR +find_path(LIBSERIALDV_INCLUDE_DIR NAMES dvcontroller.h PATHS ${SERIALDV_DIR}/include/serialdv /usr/include/serialdv @@ -9,8 +9,8 @@ find_path(LIBSERIALDV_INCLUDE_DIR set(LIBSERIAL_NAMES ${LIBSERIAL_NAMES} serialdv libserialdv) -find_library(LIBSERIALDV_LIBRARY - NAMES ${LIBSERIALDV_NAMES} +find_library(LIBSERIALDV_LIBRARY + NAMES serialdv PATHS ${SERIALDV_DIR}/lib /usr/lib /usr/local/lib diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index c8732e590..2612a7941 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -255,8 +255,11 @@ if (LIBSERIALDV_FOUND) dsp/dvserialworker.h dsp/dvserialengine.h ) + message(STATUS "Will have SerialDV support") add_definitions(-DDSD_USE_SERIALDV) include_directories(${LIBSERIALDV_INCLUDE_DIR}) +else(LIBSERIALDV_FOUND) + message(STATUS "No SerialDV support") endif(LIBSERIALDV_FOUND) if (BUILD_DEBIAN) diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 38fbeb05b..a8f399157 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1449,29 +1449,38 @@ void MainWindow::on_action_DV_Serial_triggered(bool checked) if (checked) { - std::vector deviceNames; - m_dspEngine->getDVSerialNames(deviceNames); - - if (deviceNames.size() == 0) + if (m_dspEngine->hasDVSerialSupport()) { - QMessageBox::information(this, tr("Message"), tr("No DV serial devices found")); + std::vector deviceNames; + m_dspEngine->getDVSerialNames(deviceNames); + + if (deviceNames.size() == 0) + { + QMessageBox::information(this, tr("Message"), tr("No DV serial devices found")); + qDebug("MainWindow::on_action_DV_Serial_triggered: No DV serial devices found"); + } + else + { + std::vector::iterator it = deviceNames.begin(); + std::string deviceNamesStr = "DV Serial devices found: "; + + while (it != deviceNames.end()) + { + if (it != deviceNames.begin()) { + deviceNamesStr += ","; + } + + deviceNamesStr += *it; + ++it; + } + + QMessageBox::information(this, tr("Message"), tr(deviceNamesStr.c_str())); + } } else { - std::vector::iterator it = deviceNames.begin(); - std::string deviceNamesStr = "DV Serial devices found: "; - - while (it != deviceNames.end()) - { - if (it != deviceNames.begin()) { - deviceNamesStr += ","; - } - - deviceNamesStr += *it; - ++it; - } - - QMessageBox::information(this, tr("Message"), tr(deviceNamesStr.c_str())); + QMessageBox::information(this, tr("Message"), tr("No DV serial support")); + qDebug("MainWindow::on_action_DV_Serial_triggered: No DV serial support"); } } }