stm32_serDes_protobuf_project/app/CMakeLists.txt
2024-05-13 15:21:22 +03:00

28 lines
765 B
CMake

set(elf_file stm32.elf)
add_executable(${elf_file}
main.c
syscalls.c
)
target_link_libraries(${elf_file} PUBLIC
bsp
)
target_include_directories(${elf_file} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
set(EXECUTABLE ${PROJECT_NAME}.elf)
add_custom_command(TARGET ${EXECUTABLE}
POST_BUILD
COMMAND ${CMAKE_SIZE_UTIL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}
)
add_custom_command(TARGET ${EXECUTABLE}
POST_BUILD
COMMAND ${CMAKE_OBJCOPY} -O ihex ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.hex
COMMAND ${CMAKE_OBJCOPY} -O binary ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}.bin
)