cmake magic
This commit is contained in:
parent
df85ca4267
commit
6f51f5e962
4 changed files with 20 additions and 10 deletions
|
@ -18,7 +18,7 @@ if (PICO_SDK_VERSION_STRING VERSION_LESS "1.5.0")
|
||||||
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.5.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
|
message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.5.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(raspi_keyer C CXX ASM)
|
project(raspi_keyer VERSION "0.0.1" LANGUAGES C CXX ASM)
|
||||||
|
|
||||||
# Initialise the Raspberry Pi Pico SDK
|
# Initialise the Raspberry Pi Pico SDK
|
||||||
pico_sdk_init()
|
pico_sdk_init()
|
||||||
|
@ -29,7 +29,7 @@ add_executable(raspi_keyer)
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
pico_set_program_name(raspi_keyer "raspi_keyer")
|
pico_set_program_name(raspi_keyer "raspi_keyer")
|
||||||
pico_set_program_version(raspi_keyer "0.0.1")
|
pico_set_program_version(raspi_keyer ${PROJECT_VERSION})
|
||||||
|
|
||||||
pico_enable_stdio_uart(raspi_keyer 1)
|
pico_enable_stdio_uart(raspi_keyer 1)
|
||||||
pico_enable_stdio_usb(raspi_keyer 0)
|
pico_enable_stdio_usb(raspi_keyer 0)
|
||||||
|
@ -46,11 +46,6 @@ target_include_directories(raspi_keyer PRIVATE
|
||||||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required
|
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make sure TinyUSB can find tusb_config.h
|
|
||||||
target_include_directories(raspi_keyer PUBLIC
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add any user requested libraries
|
# Add any user requested libraries
|
||||||
target_link_libraries(raspi_keyer
|
target_link_libraries(raspi_keyer
|
||||||
hardware_flash
|
hardware_flash
|
||||||
|
@ -61,8 +56,6 @@ target_link_libraries(raspi_keyer
|
||||||
hardware_adc
|
hardware_adc
|
||||||
tinyusb_device
|
tinyusb_device
|
||||||
tinyusb_board
|
tinyusb_board
|
||||||
#hardware_pio
|
|
||||||
#hardware_uart
|
|
||||||
)
|
)
|
||||||
|
|
||||||
pico_add_extra_outputs(raspi_keyer)
|
pico_add_extra_outputs(raspi_keyer)
|
||||||
|
|
|
@ -1,3 +1,16 @@
|
||||||
|
configure_file(config.h.in config.h @ONLY)
|
||||||
|
|
||||||
|
# Make sure TinyUSB can find tusb_config.h
|
||||||
|
target_include_directories(raspi_keyer PUBLIC
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Make sure the compiler can find the
|
||||||
|
# generated config.h
|
||||||
|
target_include_directories(raspi_keyer PUBLIC
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
target_sources(raspi_keyer PRIVATE
|
target_sources(raspi_keyer PRIVATE
|
||||||
raspi_keyer.cpp
|
raspi_keyer.cpp
|
||||||
settings.cpp
|
settings.cpp
|
||||||
|
|
3
src/config.h.in
Normal file
3
src/config.h.in
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@"
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "keyer.h"
|
#include "keyer.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
#include <config.h>
|
||||||
#include "tusb_config.h"
|
#include "tusb_config.h"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
|
@ -199,7 +200,7 @@ int main()
|
||||||
board_init();
|
board_init();
|
||||||
tud_init(BOARD_TUD_RHPORT);
|
tud_init(BOARD_TUD_RHPORT);
|
||||||
|
|
||||||
printf("Hello from core0!\n");
|
printf("RaspiKeyer Version %s\n", PROJECT_VERSION);
|
||||||
|
|
||||||
queue_init(&keyerQueue, sizeof(KeyerQueueData), 2);
|
queue_init(&keyerQueue, sizeof(KeyerQueueData), 2);
|
||||||
multicore_reset_core1();
|
multicore_reset_core1();
|
||||||
|
|
Loading…
Reference in a new issue