CMakeLists.txt 924 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Set minimum required version of CMake
  2. cmake_minimum_required(VERSION 3.12)
  3. # Include build functions from Pico SDK
  4. include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
  5. # Set name of project (as PROJECT_NAME) and C/C standards
  6. project(blink C CXX ASM)
  7. set(CMAKE_C_STANDARD 11)
  8. set(CMAKE_CXX_STANDARD 17)
  9. # Creates a pico-sdk subdirectory in our project for the libraries
  10. pico_sdk_init()
  11. # Tell CMake where to find the executable source file
  12. add_executable(${PROJECT_NAME}
  13. src/main.cpp
  14. )
  15. # Create map/bin/hex/uf2 files
  16. pico_add_extra_outputs(${PROJECT_NAME})
  17. add_subdirectory(libs/foo)
  18. target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/inc)
  19. # Link to pico_stdlib (gpio, time, etc. functions)
  20. target_link_libraries(${PROJECT_NAME}
  21. pico_stdlib
  22. foo
  23. )
  24. # Enable usb output, disable uart output
  25. pico_enable_stdio_usb(${PROJECT_NAME} 0)
  26. pico_enable_stdio_uart(${PROJECT_NAME} 1)