2020-06-10 04:13:56 +02:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
project(sdrpp)
|
|
|
|
|
2020-07-20 00:43:36 +02:00
|
|
|
if (MSVC)
|
|
|
|
set(CMAKE_CXX_FLAGS "-O2 /std:c++17")
|
|
|
|
link_directories(sdrpp "C:/Program Files/PothosSDR/lib/")
|
|
|
|
include_directories(sdrpp "C:/Program Files/PothosSDR/include/volk/")
|
|
|
|
include_directories(sdrpp "C:/Program Files/PothosSDR/include/")
|
|
|
|
else()
|
2020-07-20 15:26:59 +02:00
|
|
|
set(CMAKE_CXX_FLAGS "-O3 -std=c++17 -fsanitize=address -g")
|
2020-07-20 13:36:16 +02:00
|
|
|
include_directories(sdrpp "/usr/include/volk")
|
|
|
|
link_libraries(pthread)
|
|
|
|
link_libraries(GL)
|
|
|
|
link_libraries(GLEW)
|
|
|
|
link_libraries(glfw)
|
|
|
|
link_libraries(fftw3)
|
|
|
|
link_libraries(fftw3f)
|
|
|
|
link_libraries(portaudio)
|
2020-07-20 16:04:45 +02:00
|
|
|
link_libraries(X11)
|
|
|
|
link_libraries(Xxf86vm)
|
2020-08-12 16:43:44 +02:00
|
|
|
link_libraries(dl)
|
2020-07-20 00:43:36 +02:00
|
|
|
endif (MSVC)
|
2020-07-09 16:02:58 +02:00
|
|
|
|
2020-06-22 16:45:57 +02:00
|
|
|
link_libraries(volk)
|
|
|
|
link_libraries(SoapySDR)
|
|
|
|
|
2020-06-10 04:13:56 +02:00
|
|
|
# Main code
|
|
|
|
include_directories(sdrpp "src/")
|
|
|
|
include_directories(sdrpp "src/imgui")
|
|
|
|
file(GLOB SRC "src/*.cpp")
|
|
|
|
file(GLOB IMGUI "src/imgui/*.cpp")
|
|
|
|
add_executable(sdrpp ${SRC} ${IMGUI})
|
|
|
|
|
2020-07-20 00:43:36 +02:00
|
|
|
if (MSVC)
|
|
|
|
# Glew
|
|
|
|
find_package(GLEW REQUIRED)
|
|
|
|
target_link_libraries(sdrpp PRIVATE GLEW::GLEW)
|
|
|
|
|
|
|
|
# GLFW3
|
|
|
|
find_package(glfw3 CONFIG REQUIRED)
|
|
|
|
target_link_libraries(sdrpp PRIVATE glfw)
|
|
|
|
|
|
|
|
# FFTW3
|
|
|
|
find_package(FFTW3 CONFIG REQUIRED)
|
|
|
|
target_link_libraries(sdrpp PRIVATE FFTW3::fftw3)
|
|
|
|
find_package(FFTW3f CONFIG REQUIRED)
|
|
|
|
target_link_libraries(sdrpp PRIVATE FFTW3::fftw3f)
|
|
|
|
|
|
|
|
# PortAudio
|
|
|
|
find_package(portaudio CONFIG REQUIRED)
|
|
|
|
target_link_libraries(sdrpp PRIVATE portaudio portaudio_static)
|
|
|
|
endif (MSVC)
|
2020-07-19 15:59:44 +02:00
|
|
|
|
2020-08-05 12:50:34 +02:00
|
|
|
# # Copy resource directories
|
|
|
|
# if (!MSVC)
|
|
|
|
# add_custom_command(TARGET sdrpp POST_BUILD COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/res ${CMAKE_BINARY_DIR}/res)
|
|
|
|
# add_custom_command(TARGET sdrpp POST_BUILD COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/bandplans ${CMAKE_BINARY_DIR}/bandplans)
|
|
|
|
# endif (MSVC)
|
2020-07-19 15:59:44 +02:00
|
|
|
|
|
|
|
# cmake .. "-DCMAKE_TOOLCHAIN_FILE=C:/Users/Alex/vcpkg/scripts/buildsystems/vcpkg.cmake" -G "Visual Studio 15 2017 Win64"
|