vfo-sync

Bidirectional VFO synchronization for IC-7300 and SDR++
git clone https://git.bradleygannon.com/vfo-sync.git
Log | Files | Refs

CMakeLists.txt (1444B)


      1 cmake_minimum_required(VERSION 3.13)
      2 project(civ_sync)
      3 
      4 set(SDRPP_DIR "" CACHE PATH "Path to the SDR++ source root")
      5 if (NOT SDRPP_DIR)
      6     message(FATAL_ERROR "SDRPP_DIR must be set to the SDR++ source root")
      7 endif()
      8 
      9 set(CIV_STATICLIB "${CMAKE_CURRENT_SOURCE_DIR}/../target/release/libciv_sync.a"
     10     CACHE FILEPATH "Path to the built Rust staticlib")
     11 if (NOT EXISTS "${CIV_STATICLIB}")
     12     message(FATAL_ERROR "Rust staticlib not found at ${CIV_STATICLIB}; run 'cargo build --release' first")
     13 endif()
     14 
     15 set(SDRPP_CORE_LIB "${SDRPP_DIR}/build/core/libsdrpp_core.so"
     16     CACHE FILEPATH "Path to the built libsdrpp_core.so")
     17 if (NOT EXISTS "${SDRPP_CORE_LIB}")
     18     message(FATAL_ERROR "libsdrpp_core.so not found at ${SDRPP_CORE_LIB}; build the SDR++ core first")
     19 endif()
     20 
     21 find_package(OpenGL REQUIRED)
     22 find_package(PkgConfig REQUIRED)
     23 pkg_check_modules(UDEV REQUIRED IMPORTED_TARGET libudev)
     24 
     25 file(GLOB SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
     26 
     27 add_library(${PROJECT_NAME} SHARED ${SRC})
     28 
     29 target_include_directories(${PROJECT_NAME} PRIVATE
     30     "${SDRPP_DIR}/core/src"
     31     "${SDRPP_DIR}/core/src/imgui"
     32     "${SDRPP_DIR}/decoder_modules/radio/src"
     33     ${OPENGL_INCLUDE_DIRS}
     34 )
     35 
     36 target_link_libraries(${PROJECT_NAME} PRIVATE
     37     "${SDRPP_CORE_LIB}"
     38     "${CIV_STATICLIB}"
     39     PkgConfig::UDEV
     40     pthread dl m
     41 )
     42 
     43 target_compile_options(${PROJECT_NAME} PRIVATE -std=c++17 -O2 -fPIC)
     44 
     45 set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")