Skip to content

Commit

Permalink
Add esp32 camera dir (#23)
Browse files Browse the repository at this point in the history
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 <gentijo@gmail.com>
  • Loading branch information
gentijo authored Jan 22, 2025
1 parent c979972 commit 1f030d9
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/micropython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,4 +38,4 @@ endif()

target_link_libraries(usermod INTERFACE usermod_mp_camera)

micropy_gather_target_properties(usermod_mp_camera)
micropy_gather_target_properties(usermod_mp_camera)

0 comments on commit 1f030d9

Please sign in to comment.