-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
34 lines (34 loc) · 4.66 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
cmake_minimum_required(VERSION 3.25)
set(CMAKE_VERBOSE_MAKEFILE ON)
project(sdrberry)
set (PROJECT_VENDOR "PA0PHH")
set (PROJECT_COPYRIGHT "Copyright (C) 2021-2023 by Paul, PA0PHH")
set (CPACK_RPM_PACKAGE_REQUIRES "libgfortran >= 7, fftw-libs-single >= 3.3, boost-log >= 1.62")
include(FetchContent)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(MINIMUM_GCC_VERSION "12.2")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${MINIMUM_GCC_VERSION})
message(FATAL_ERROR "GCC version must be at least ${MINIMUM_GCC_VERSION}. You are using ${CMAKE_CXX_COMPILER_VERSION}.")
endif()
endif()
set(LV_CONF_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lv_conf.h CACHE STRING "" FORCE)
FetchContent_Declare(lvgl GIT_REPOSITORY https://github.com/paulh002/lvgl.git GIT_TAG v8.4.1)
FetchContent_Declare(wsjtx_lib GIT_REPOSITORY https://github.com/paulh002/wsjtx_lib.git GIT_TAG master)
FetchContent_Declare(nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG master)
FetchContent_MakeAvailable(lvgl wsjtx_lib nlohmann_json)
set(LIBRARIES_FROM_REFERENCES -lbfd -ldw -ldl -lpthread -latomic -lSoapySDR -lliquid -lasound -lfftw3f -lfftw3f_threads -lgfortran -Wl,-gc-sections)
add_executable(sdrberry sdrberry.cpp civetweb.c CivetServer.cpp CivetServer.h WebServer.cpp WebServer.h WebRestHandler.cpp WebRestHandler.h screen.h ui_img_btn_knob_png.c guiSliderWindows.cpp guiSliderWindows.h guiButtonWindows.cpp guiButtonWindows.h CustomEvents.cpp CustomEvents.h table.cpp table.h NoiseFilter.cpp NoiseFilter.h guiButtonWindows.cpp guiButtonWindows.h cmeter.cpp cmeter.h PeakFinder.cpp PeakFinder.h PeakMeasurement.cpp PeakMeasurement.h TCA9548.cpp TCA9548.h MCP23008.cpp MCP23008.h gui_i2csetup.cpp gui_i2csetup.h HexKeyboardWindow.cpp HexKeyboardWindow.h FreeDVTab.cpp FreeDVTab.h Spectrum.cpp Spectrum.h FastFourier.cpp FastFourier.h Waterfall.cpp Waterfall.h mouse_cursor_icon.c IQGenerator.cpp IQGenerator.h GuiFt8Setting.cpp GuiFt8Setting.h EnergyCalculator.cpp EnergyCalculator.h Limiter.cpp Limiter.h RtAudio.cpp backward.hpp DigitalTransmission.cpp DigitalTransmission.h FT8Processor.cpp FT8Processor.h FT8Demodulator.cpp FT8Demodulator.h SpectralNoiseReduction.cpp SpectralNoiseReduction.h LMSNoisereducer.cpp LMSNoisereducer.h HidDev.cpp HidDev.h PeakLevelDetector.cpp PeakLevelDetector.h gui_cal.cpp gui_cal.h gui_ft8.cpp gui_ft8.h gui_ft8bar.cpp gui_ft8bar.h gui_rx.h gui_rx.cpp gui_speech.cpp gui_speech.h FMDemodulator.cpp Agc_class.cpp AMDemodulator.cpp AMModulator.cpp AudioInput.cpp AudioOutput.cpp BandFilter.cpp Catinterface.cpp configfile.cpp configoption.cpp Demodulator.cpp Filter.cpp FmDecode.cpp FMDemodulator.cpp FMModulator.cpp FreeSansOblique24.c FreeSansOblique32.c FreeSansOblique42.c FT891_CAT.cpp gui_agc.cpp Gui_band.cpp gui_bar.cpp gui_setup.cpp gui_top_bar.cpp gui_tx.cpp gui_vfo.cpp Keyboard.cpp KeyboardTranslator.cpp MidiControle.cpp Mouse.cpp PCF8574.cpp RtMidi.cpp SdrDevice.cpp sdrstream.cpp Settings.cpp vfo.cpp Waterfall.cpp wiringPiI2C.c wiringSerial.c lv_drivers/display/fbdev.c lv_drivers/indev/evdev.c lv_drivers/indev/mouse.c Agc_class.h AMDemodulator.h AMModulator.h AudioInput.h AudioOutput.h BandFilter.h Catinterface.h configfile.h configoption.h DataBuffer.h Demodulator.h Filter.h FmDecode.h FMDemodulator.h FMModulator.h FT891_CAT.h gattlib.h gui_agc.h Gui_band.h gui_bar.h gui_setup.h gui_top_bar.h gui_tx.h gui_vfo.h Keyboard.h lv_conf.h lv_drv_conf.h MidiControle.h Mouse.h PCF8574.h RtAudio.h RtMidi.h sdrberry.h SdrDevice.h sdrstream.h sma.h Settings.h vfo.h Waterfall.h wiringPiI2C.h wiringSerial.h strlib.cpp strlib.h MorseDecoder.cpp MorseDecoder.h EchoAudio.cpp EchoAudio.h wave.cpp FreeSans42.c ${SOURCES} lv_drivers/indev/evdev.h)
set_property(TARGET sdrberry PROPERTY CXX_STANDARD 20)
target_compile_definitions(sdrberry PRIVATE RELEASE=1 __LINUX_ALSA__ LV_LVGL_H_INCLUDE_SIMPLE NO_SSL=1 USE_WEBSOCKET=1)
target_compile_options(sdrberry PRIVATE -O3 -ggdb -Wno-unused-parameter -Wno-reorder -Wno-unused-variable -Wno-deprecated -Wno-deprecated-declarations -I "." )
target_compile_options(sdrberry PRIVATE )
target_link_libraries(sdrberry PRIVATE wsjtx_lib)
target_include_directories(sdrberry PRIVATE /usr/local/include/liquid build/_deps/wsjtx_lib-src ${CMAKE_BINARY_DIR}/include)
target_link_libraries(sdrberry PRIVATE "${LIBRARIES_FROM_REFERENCES}")
target_link_libraries(sdrberry PRIVATE lvgl::lvgl)
target_link_libraries(sdrberry PRIVATE nlohmann_json::nlohmann_json)
install(TARGETS sdrberry DESTINATION /usr/local/bin)
add_custom_target(sdrweb DEPENDS ${CMAKE_SOURCE_DIR}/sdrweb)
add_custom_command(TARGET sdrweb PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory /home/pi/sdrweb
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/sdrweb /home/pi/sdrweb)