From 1f030d953bb870fb91026b2a2d13510ef1bb0e7c Mon Sep 17 00:00:00 2001 From: John Gentilin Date: Tue, 21 Jan 2025 21:19:41 -0800 Subject: [PATCH] Add esp32 camera dir (#23) minor change that allows to override the directories where the includes exist for the esp32-camera component. It should function the same as before, if you do not provide an override. --------- Signed-off-by: John Gentilin --- src/micropython.cmake | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/micropython.cmake b/src/micropython.cmake index 66fd308..369f867 100644 --- a/src/micropython.cmake +++ b/src/micropython.cmake @@ -8,14 +8,20 @@ target_sources(usermod_mp_camera INTERFACE ${CMAKE_CURRENT_LIST_DIR}/modcamera_api.c ) -if(EXISTS "${IDF_PATH}/components/esp32-camera") +if(NOT ESP32_CAMERA_DIR) + set(ESP32_CAMERA_DIR "${IDF_PATH}/components/esp32-camera") +endif() + +message("Camera Dir: ${ESP32_CAMERA_DIR}") + +if(EXISTS "${ESP32_CAMERA_DIR}") target_include_directories(usermod_mp_camera INTERFACE ${CMAKE_CURRENT_LIST_DIR} - ${IDF_PATH}/components/esp32-camera/driver/include - ${IDF_PATH}/components/esp32-camera/driver/private_include - ${IDF_PATH}/components/esp32-camera/conversions/include - ${IDF_PATH}/components/esp32-camera/conversions/private_include - ${IDF_PATH}/components/esp32-camera/sensors/private_include + ${ESP32_CAMERA_DIR}/driver/include + ${ESP32_CAMERA_DIR}/driver/private_include + ${ESP32_CAMERA_DIR}/conversions/include + ${ESP32_CAMERA_DIR}/conversions/private_include + ${ESP32_CAMERA_DIR}/sensors/private_include ) else() target_include_directories(usermod_mp_camera INTERFACE @@ -32,4 +38,4 @@ endif() target_link_libraries(usermod INTERFACE usermod_mp_camera) -micropy_gather_target_properties(usermod_mp_camera) \ No newline at end of file +micropy_gather_target_properties(usermod_mp_camera)