cmake_minimum_required(VERSION 3.8)
project(detectssb CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()

# SoapySDR is the only dependency: the detector reaches the Amarisoft card
# through the support module, never through libsdr directly.
find_package(SoapySDR "0.7" REQUIRED)

add_executable(detectssb detectssb.cpp)

target_link_libraries(detectssb PRIVATE SoapySDR)

# The correlator is the hot path, so let the compiler vectorise it.
target_compile_options(detectssb PRIVATE -Wall -Wextra -O3)

install(TARGETS detectssb RUNTIME DESTINATION bin)
