### Include Directories Setup Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Configures include paths for the current source directory and RTLSDR headers. ```cmake include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${RTLSDR_INCLUDE_DIRS}) ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Sets the minimum required CMake version and defines the project name and language. ```cmake cmake_minimum_required(VERSION 2.8.12...3.10) project(SoapyRTLSDR CXX) ``` -------------------------------- ### Uninstall Target Configuration Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Adds a custom 'uninstall' target and configures the uninstall script using a template. ```cmake add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) ``` -------------------------------- ### Enable C++11 Features for GCC/Clang Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Enables C++11 standard and adds necessary flags like -pthread for GCC and Clang compilers. Also disables warnings for unused parameters. ```cmake if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") #C++11 is a required language feature for this project include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" HAS_STD_CXX11) if(HAS_STD_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else(HAS_STD_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") endif() #Thread support enabled (not the same as -lpthread) list(APPEND RTLSDR_LIBRARIES -pthread) #disable warnings for unused parameters add_compile_options(-Wall -Wextra -Wno-unused-parameter) endif() ``` -------------------------------- ### Define SoapySDR Module Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Uses the SOAPY_SDR_MODULE_UTIL macro to define the rtlsdrSupport target, specifying source files and linking libraries. ```cmake set(OTHER_LIBS "" CACHE STRING "Other libraries") SOAPY_SDR_MODULE_UTIL( TARGET rtlsdrSupport SOURCES SoapyRTLSDR.hpp Registration.cpp Settings.cpp Streaming.cpp LIBRARIES ${RTLSDR_LIBRARIES} ${ATOMIC_LIBS} ${OTHER_LIBS} ) ``` -------------------------------- ### Check for Atomics Support Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Includes a CMake module to check for C++ atomics support and sets a library variable if needed. ```cmake include(CheckAtomic) if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) set(ATOMIC_LIBS "atomic") endif() ``` -------------------------------- ### Check for RTLSDR Bias-Tee and Dithering Support Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Checks if the rtlsdr library supports bias-tee and dithering functions using CheckFunctionExists. Defines preprocessor macros if supported. ```cmake include(CheckFunctionExists) set(CMAKE_REQUIRED_LIBRARIES ${RTLSDR_LIBRARIES}) check_function_exists(rtlsdr_set_bias_tee HAS_RTLSDR_SET_BIAS_TEE) check_function_exists(rtlsdr_set_dithering HAS_RTLSDR_SET_DITHERING) unset(CMAKE_REQUIRED_LIBRARIES) if (HAS_RTLSDR_SET_BIAS_TEE) add_definitions(-DHAS_RTLSDR_SET_BIAS_TEE) endif() if (HAS_RTLSDR_SET_DITHERING) add_definitions(-DHAS_RTLSDR_SET_DITHERING) endif() ``` -------------------------------- ### Enable C++11 Features for Apple Clang Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Sets specific C++11 flags for Clang compiler on Apple platforms. ```cmake if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wc++11-extensions") endif(APPLE) ``` -------------------------------- ### Find SoapySDR Dependency Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Locates the SoapySDR library and its development files. Exits if not found. ```cmake find_package(SoapySDR "0.4.0" NO_MODULE REQUIRED) if (NOT SoapySDR_FOUND) message(FATAL_ERROR "Soapy SDR development files not found...") endif () ``` -------------------------------- ### Find RTLSDR Dependency Source: https://github.com/pothosware/soapyrtlsdr/blob/master/CMakeLists.txt Locates the RTLSDR library and its development files. Exits if not found and prints include directories and libraries. ```cmake list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) find_package(RTLSDR) if (NOT RTLSDR_FOUND) message(FATAL_ERROR "RTL-SDR development files not found...") endif () message(STATUS "RTLSDR_INCLUDE_DIRS - ${RTLSDR_INCLUDE_DIRS}") message(STATUS "RTLSDR_LIBRARIES - ${RTLSDR_LIBRARIES}") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.