diff --git a/src/goesproc/CMakeLists.txt b/src/goesproc/CMakeLists.txt index 8778c547..4a6dca14 100644 --- a/src/goesproc/CMakeLists.txt +++ b/src/goesproc/CMakeLists.txt @@ -43,11 +43,8 @@ target_link_libraries(goesproc timer) target_link_libraries(goesproc version) if(OPENCV_FOUND) - target_link_libraries(goesproc opencv_core opencv_highgui opencv_imgproc) + target_link_libraries(goesproc ${OPENCV_LINK_LIBRARIES}) target_include_directories(goesproc PRIVATE ${OPENCV_INCLUDE_DIRS}) - if(${OPENCV_VERSION} VERSION_GREATER 3.0) - target_link_libraries(goesproc opencv_imgcodecs) - endif() endif() if(PROJ_FOUND) @@ -60,5 +57,6 @@ if(PROJ_FOUND) PROJ_VERSION_MINOR=${PROJ_VERSION_MINOR} PROJ_VERSION_PATCH=${PROJ_VERSION_PATCH}) target_compile_definitions(goesproc PRIVATE HAS_PROJ) - target_link_libraries(goesproc proj) + target_include_directories(goesproc PRIVATE ${PROJ_INCLUDE_DIRS}) + target_link_libraries(goesproc ${PROJ_LINK_LIBRARIES}) endif() diff --git a/src/goesrecv/CMakeLists.txt b/src/goesrecv/CMakeLists.txt index b8a0934e..52f6e567 100644 --- a/src/goesrecv/CMakeLists.txt +++ b/src/goesrecv/CMakeLists.txt @@ -14,7 +14,8 @@ if(NOT AIRSPY_FOUND) message(WARNING "Unable to find libairspy") else() add_library(airspy_source airspy_source.cc) - target_link_libraries(airspy_source ${AIRSPY_LIBRARIES} publisher stdc++) + target_include_directories(airspy_source PUBLIC ${AIRSPY_INCLUDE_DIRS}) + target_link_libraries(airspy_source ${AIRSPY_LINK_LIBRARIES} publisher stdc++) endif() pkg_check_modules(RTLSDR librtlsdr) @@ -22,11 +23,22 @@ if(NOT RTLSDR_FOUND) message(WARNING "Unable to find librtlsdr") else() add_library(rtlsdr_source rtlsdr_source.cc) + + # Some rtlsdr versions begin with an extraneous 'v', such as older + # versions (<= 0.5.4) built from source, or the version provided by MacPorts. + # Newer versions built from source, as well as Debian packages, have + # versions that do not begin with this 'v'. + # Remove prefix 'v' here to handle all versions consistently. + if(RTLSDR_VERSION MATCHES "^v") + string(SUBSTRING ${RTLSDR_VERSION} 1 -1 RTLSDR_VERSION) + endif() + if((RTLSDR_VERSION VERSION_EQUAL 0.5.4) OR (RTLSDR_VERSION VERSION_GREATER 0.5.4)) target_compile_definitions(rtlsdr_source PRIVATE RTLSDR_HAS_BIAS_TEE) endif() - target_link_libraries(rtlsdr_source ${RTLSDR_LIBRARIES} publisher stdc++) + target_include_directories(rtlsdr_source PUBLIC ${RTLSDR_INCLUDE_DIRS}) + target_link_libraries(rtlsdr_source ${RTLSDR_LINK_LIBRARIES} publisher stdc++) endif() add_library(nanomsg_source nanomsg_source.cc) diff --git a/src/goesrecv/airspy_source.h b/src/goesrecv/airspy_source.h index 09c3a27e..8115f30d 100644 --- a/src/goesrecv/airspy_source.h +++ b/src/goesrecv/airspy_source.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include "source.h"