CMakeLists.txt 1015 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 local folder with libs
  18. add_subdirectory(libs/foo)
  19. # Set local include directories
  20. target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/inc)
  21. # Link to external lib pico_stdlib (gpio, time, etc. functions) and internal lib
  22. target_link_libraries(${PROJECT_NAME}
  23. pico_stdlib
  24. foo
  25. )
  26. # Enable usb output, disable uart output
  27. pico_enable_stdio_usb(${PROJECT_NAME} 1)
  28. pico_enable_stdio_uart(${PROJECT_NAME} 1)