CMakeLists.txt 544 B

12345678910111213141516171819202122
  1. include(${CMAKE_SOURCE_DIR}/pico_sdk_import.cmake)
  2. # Creates a pico-sdk subdirectory in our project for the libraries
  3. pico_sdk_init()
  4. # Set name of project (as PROJECT_NAME) and C/C standards
  5. project(foo C CXX ASM)
  6. # Add library information
  7. add_library(${PROJECT_NAME}
  8. inc/foo.h
  9. src/foo.cpp
  10. )
  11. # Set local include directories
  12. target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc)
  13. # Link to external lib pico_stdlib (gpio, time, etc. functions)
  14. target_link_libraries(${PROJECT_NAME}
  15. pico_stdlib
  16. )