-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
41 lines (36 loc) · 1.23 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.21)
project(simple_sdr_app)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(imgui REQUIRED)
find_package(implot REQUIRED)
find_package(fmt REQUIRED)
# Windows + MSYS = Install rtlsdr from submodule
# Ubuntu = Install rtlsdr from package manager
if(WIN32)
set(rtlsdr_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vendor/librtlsdr)
find_package(rtlsdr CONFIG REQUIRED)
set(RTLSDR_LIBS rtlsdr::rtlsdr)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(rtlsdr REQUIRED IMPORTED_TARGET librtlsdr)
set(RTLSDR_LIBS PkgConfig::rtlsdr)
endif()
if(WIN32)
find_package(portaudio CONFIG REQUIRED)
find_package(FFTW3f CONFIG REQUIRED)
set(PORTAUDIO_LIBS portaudio)
set(FFTW3_LIBS FFTW3::fftw3f)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(portaudio REQUIRED IMPORTED_TARGET portaudio-2.0)
pkg_check_modules(fftw3f REQUIRED IMPORTED_TARGET fftw3f)
set(PORTAUDIO_LIBS PkgConfig::portaudio)
set(FFTW3_LIBS PkgConfig::fftw3f)
endif()
# for posix threads
if(NOT WIN32)
find_package(Threads REQUIRED)
add_compile_options(-pthread)
link_libraries(Threads::Threads)
endif()
add_subdirectory(${CMAKE_SOURCE_DIR}/src)