cmake improved

This commit is contained in:
Martin Brodbeck 2022-05-31 15:22:04 +02:00
parent 91e1a7d424
commit d6d91f4cb2

View file

@ -1,4 +1,4 @@
configure_file(config.h.in ${PROJECT_BINARY_DIR}/src/config.h)
configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.in ${PROJECT_BINARY_DIR}/src/config.h)
set(SOURCES
gbmanager.cpp
@ -8,24 +8,24 @@ set(SOURCES
)
# Add executable. Default name is the project name, version 0.1
add_executable(gbmanager ${SOURCES})
add_executable(${CMAKE_PROJECT_NAME} ${SOURCES})
pico_set_program_name(gbmanager "gbmanager")
pico_set_program_version(gbmanager ${PROJECT_VERSION})
pico_set_program_name(${CMAKE_PROJECT_NAME} "gbmanager")
pico_set_program_version(${CMAKE_PROJECT_NAME} ${PROJECT_VERSION})
pico_enable_stdio_uart(gbmanager 1)
pico_enable_stdio_usb(gbmanager 0)
pico_enable_stdio_uart(${CMAKE_PROJECT_NAME} 1)
pico_enable_stdio_usb(${CMAKE_PROJECT_NAME} 0)
pico_generate_pio_header(gbmanager ${CMAKE_CURRENT_LIST_DIR}/ds18b20.pio)
pico_generate_pio_header(${CMAKE_PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ds18b20.pio)
# Add the standard library to the build
target_link_libraries(gbmanager pico_stdlib)
target_link_libraries(${CMAKE_PROJECT_NAME} pico_stdlib)
# Add any user requested libraries
target_link_libraries(gbmanager
target_link_libraries(${CMAKE_PROJECT_NAME}
hardware_i2c
hardware_gpio
hardware_pio
)
pico_add_extra_outputs(gbmanager)
pico_add_extra_outputs(${CMAKE_PROJECT_NAME})