2021-07-29 18:33:18 +00:00
|
|
|
cmake_minimum_required(VERSION 3.15)
|
2021-07-31 22:26:29 +00:00
|
|
|
|
2022-12-21 13:22:40 +00:00
|
|
|
include(cmake/pico_sdk_import.cmake) # File copied from $PICO_SDK_PATH/external
|
|
|
|
include(cmake/pico_extras_import.cmake) # File copied from $PICO_SDK_PATH/../pico-extras/external
|
2021-07-29 18:33:18 +00:00
|
|
|
|
|
|
|
project(raspi-pico-aprs-tnc VERSION 0.1)
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
|
|
|
|
pico_sdk_init()
|
|
|
|
|
|
|
|
|
2022-12-21 13:32:01 +00:00
|
|
|
# Setup of eleccoder's version of Philip Heron's 'ax25beacon' project
|
2021-07-29 18:33:18 +00:00
|
|
|
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(ax25_aprs_lib
|
2021-07-31 22:26:29 +00:00
|
|
|
GIT_REPOSITORY "https://github.com/eleccoder/ax25-aprs-lib.git"
|
|
|
|
GIT_SHALLOW ON
|
2021-07-29 18:33:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
FetchContent_MakeAvailable(ax25_aprs_lib)
|
|
|
|
|
|
|
|
add_library(ax25_aprs_lib::ax25beacon ALIAS ax25beacon)
|
|
|
|
|
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
# Compiler options
|
|
|
|
|
|
|
|
# Enable on demand only, since warnings from 3rd-party code will flood the console
|
|
|
|
# set(APRS_PICO_COMPILE_WARN_OPTIONS -Wundef -Wswitch-enum -Wall -Wextra -pedantic)
|
|
|
|
|
|
|
|
|
2022-12-21 13:32:01 +00:00
|
|
|
# ##### Configure the build of the 'aprs_pico' library #####
|
2021-07-29 18:33:18 +00:00
|
|
|
|
2021-08-01 15:18:36 +00:00
|
|
|
set(TARGET_LIB_NAME aprs_pico)
|
2021-07-29 18:33:18 +00:00
|
|
|
|
2021-08-01 15:18:36 +00:00
|
|
|
add_library(${TARGET_LIB_NAME}
|
|
|
|
src/aprs_pico.c)
|
2021-07-31 22:26:29 +00:00
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
target_compile_options(${TARGET_LIB_NAME}
|
|
|
|
PRIVATE "${APRS_PICO_COMPILE_WARN_OPTIONS}"
|
2021-08-01 15:18:36 +00:00
|
|
|
)
|
2022-12-22 20:42:56 +00:00
|
|
|
|
2021-08-01 15:18:36 +00:00
|
|
|
target_include_directories(${TARGET_LIB_NAME} PUBLIC
|
2021-07-31 22:26:29 +00:00
|
|
|
include
|
2021-07-29 18:33:18 +00:00
|
|
|
)
|
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
set_target_properties(${TARGET_LIB_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
)
|
|
|
|
|
2021-08-01 15:18:36 +00:00
|
|
|
target_link_libraries(${TARGET_LIB_NAME}
|
|
|
|
ax25_aprs_lib::ax25beacon
|
|
|
|
pico_audio_pwm
|
|
|
|
pico_stdlib
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
# ##### Configure the build of the DEMO applications #####
|
2021-08-01 15:18:36 +00:00
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
set(TARGET_DEMO_EXE_NAME aprs_pico_beacon_demo)
|
2021-08-01 15:18:36 +00:00
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
add_executable(${TARGET_DEMO_EXE_NAME}
|
|
|
|
src/aprs_pico_beacon_demo.c
|
2021-08-01 15:18:36 +00:00
|
|
|
)
|
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
target_compile_options(${TARGET_DEMO_EXE_NAME}
|
|
|
|
PRIVATE "${APRS_PICO_COMPILE_WARN_OPTIONS}"
|
2021-08-01 15:18:36 +00:00
|
|
|
)
|
2021-07-29 18:33:18 +00:00
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
target_include_directories(${TARGET_DEMO_EXE_NAME} PRIVATE
|
|
|
|
include
|
|
|
|
)
|
2021-07-29 18:33:18 +00:00
|
|
|
|
2022-12-21 13:32:01 +00:00
|
|
|
# Create map/bin/hex file etc.
|
2022-12-22 20:42:56 +00:00
|
|
|
pico_add_extra_outputs(${TARGET_DEMO_EXE_NAME})
|
2021-07-31 22:26:29 +00:00
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
target_link_libraries(${TARGET_DEMO_EXE_NAME}
|
2021-08-01 15:18:36 +00:00
|
|
|
${TARGET_LIB_NAME}
|
2021-07-31 22:26:29 +00:00
|
|
|
ax25_aprs_lib::ax25beacon
|
2021-08-01 15:18:36 +00:00
|
|
|
pico_audio_pwm
|
|
|
|
pico_stdlib
|
2021-07-31 22:26:29 +00:00
|
|
|
)
|
2021-07-29 18:33:18 +00:00
|
|
|
|
2022-12-22 20:42:56 +00:00
|
|
|
|
|
|
|
# ##### Configure the build of the TEST application #####
|
|
|
|
|
|
|
|
set(TARGET_TEST_EXE_NAME aprs_pico_tone_test)
|
|
|
|
|
|
|
|
add_executable(${TARGET_TEST_EXE_NAME}
|
|
|
|
src/aprs_pico_tone_test.c
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_options(${TARGET_TEST_EXE_NAME}
|
|
|
|
PRIVATE "${APRS_PICO_COMPILE_WARN_OPTIONS}"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(${TARGET_TEST_EXE_NAME} PRIVATE
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
|
|
|
# Create map/bin/hex file etc.
|
|
|
|
pico_add_extra_outputs(${TARGET_TEST_EXE_NAME})
|
|
|
|
|
|
|
|
target_link_libraries(${TARGET_TEST_EXE_NAME}
|
|
|
|
${TARGET_LIB_NAME}
|
|
|
|
pico_audio_pwm
|
|
|
|
pico_stdlib
|
|
|
|
)
|