Ravago Jones | 9c10b2a | 2023-02-06 12:41:59 -0800 | [diff] [blame] | 1 | |
| 2 | cmake_minimum_required(VERSION 3.13) |
| 3 | |
| 4 | # initialize the SDK based on PICO_SDK_PATH |
| 5 | # note: this must happen before project() |
| 6 | |
| 7 | #set(PICO_SDK_FETCH_FROM_GIT 1) |
| 8 | set(PICO_SDK_PATH ../../../third_party/pico-sdk) |
| 9 | set(PICO_TOOLCHAIN_PATH ../../external/gcc_arm_none_eabi/bin) |
| 10 | |
| 11 | include(../../third_party/pico-sdk/external/pico_sdk_import.cmake) |
| 12 | |
| 13 | project(tof_controller) |
| 14 | |
| 15 | # the root of the repository |
| 16 | include_directories(../../) |
| 17 | |
| 18 | # initialize the Raspberry Pi Pico SDK |
| 19 | pico_sdk_init() |
| 20 | |
| 21 | set(CMAKE_CXX_STANDARD 17) |
| 22 | |
| 23 | # rest of your project |
| 24 | |
| 25 | include_directories(../../external/vl53l1x_ultra_lite_driver_api) |
| 26 | add_library(VL53L1X |
| 27 | ../../external/vl53l1x_ultra_lite_driver_api/platform/vl53l1_platform.h |
| 28 | ../../external/vl53l1x_ultra_lite_driver_api/platform/vl53l1_platform.c |
| 29 | ../../external/vl53l1x_ultra_lite_driver_api/platform/vl53l1_types.h |
| 30 | ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_api.c |
| 31 | ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_api.h |
| 32 | ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_calibration.h |
| 33 | ../../external/vl53l1x_ultra_lite_driver_api/core/VL53L1X_calibration.c) |
| 34 | |
| 35 | add_executable(tof_controller |
| 36 | tof_controller.cc |
| 37 | ) |
| 38 | |
| 39 | # pull in common dependencies |
| 40 | target_link_libraries(tof_controller VL53L1X) |
| 41 | target_link_libraries(VL53L1X pico_stdlib hardware_i2c hardware_pwm) |
| 42 | target_link_libraries(tof_controller pico_stdlib hardware_i2c) |
| 43 | |
| 44 | # enable usb output, disable uart output |
| 45 | pico_enable_stdio_usb(tof_controller 1) |
| 46 | pico_enable_stdio_uart(tof_controller 0) |
| 47 | |
| 48 | # create map/bin/hex/uf2 file etc. |
| 49 | pico_add_extra_outputs(tof_controller) |
| 50 | |