CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. cmake_minimum_required(VERSION 3.5)
  2. include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
  3. # gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
  4. family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
  5. project(${PROJECT})
  6. # Checks this example is valid for the family and initializes the project
  7. family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
  8. add_executable(${PROJECT})
  9. # Example source
  10. target_sources(${PROJECT} PUBLIC
  11. ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
  12. ${CMAKE_CURRENT_SOURCE_DIR}/src/msc_app.c
  13. ${TOP}/lib/fatfs/source/ff.c
  14. ${TOP}/lib/fatfs/source/ffsystem.c
  15. ${TOP}/lib/fatfs/source/ffunicode.c
  16. )
  17. # Example include
  18. target_include_directories(${PROJECT} PUBLIC
  19. ${CMAKE_CURRENT_SOURCE_DIR}/src
  20. ${TOP}/lib/fatfs/source
  21. ${TOP}/lib/embedded-cli
  22. )
  23. # Configure compilation flags and libraries for the example... see the corresponding function
  24. # in hw/bsp/FAMILY/family.cmake for details.
  25. family_configure_host_example(${PROJECT})
  26. # For rp2040 enable pico-pio-usb
  27. if(FAMILY STREQUAL "rp2040")
  28. family_add_pico_pio_usb(${PROJECT})
  29. # due to warnings from Pico-PIO-USB
  30. target_compile_options(${PROJECT} PUBLIC
  31. -Wno-error=cast-qual
  32. -Wno-error=sign-conversion
  33. -Wno-error=conversion
  34. )
  35. endif()