if(CONFIG_OPENMV_SUPPORT)
set(OMV_SRCS
  ${PROJECT_DIR}/omv/alloc/xalloc.c
  ${PROJECT_DIR}/omv/alloc/fb_alloc.c
  ${PROJECT_DIR}/omv/alloc/umm_malloc.c
  ${PROJECT_DIR}/omv/alloc/dma_alloc.c
  ${PROJECT_DIR}/omv/alloc/unaligned_memcpy.c
  
  ${PROJECT_DIR}/omv/common/array.c
  ${PROJECT_DIR}/omv/common/ff_wrapper.c
  ${PROJECT_DIR}/omv/common/ini.c
  ${PROJECT_DIR}/omv/common/ringbuf.c
  ${PROJECT_DIR}/omv/common/trace.c
  ${PROJECT_DIR}/omv/common/mutex.c
  
  ${PROJECT_DIR}/omv/imlib/agast.c
  ${PROJECT_DIR}/omv/imlib/apriltag.c
  ${PROJECT_DIR}/omv/imlib/bayer.c                     
  ${PROJECT_DIR}/omv/imlib/binary.c                    
  ${PROJECT_DIR}/omv/imlib/blob.c                      
  ${PROJECT_DIR}/omv/imlib/bmp.c                       
  ${PROJECT_DIR}/omv/imlib/clahe.c                     
  ${PROJECT_DIR}/omv/imlib/collections.c               
  ${PROJECT_DIR}/omv/imlib/dmtx.c                      
  ${PROJECT_DIR}/omv/imlib/draw.c                      
  ${PROJECT_DIR}/omv/imlib/edge.c                      
  ${PROJECT_DIR}/omv/imlib/eye.c                       
  ${PROJECT_DIR}/omv/imlib/fast.c                      
  ${PROJECT_DIR}/omv/imlib/fft.c                       
  ${PROJECT_DIR}/omv/imlib/filter.c                    
  ${PROJECT_DIR}/omv/imlib/fmath.c                     
  ${PROJECT_DIR}/omv/imlib/font.c                      
  ${PROJECT_DIR}/omv/imlib/framebuffer.c               
  ${PROJECT_DIR}/omv/imlib/fsort.c                     
  ${PROJECT_DIR}/omv/imlib/gif.c                       
  ${PROJECT_DIR}/omv/imlib/haar.c                      
  ${PROJECT_DIR}/omv/imlib/hog.c                       
  ${PROJECT_DIR}/omv/imlib/hough.c                     
  ${PROJECT_DIR}/omv/imlib/imlib.c                     
  ${PROJECT_DIR}/omv/imlib/integral.c                  
  ${PROJECT_DIR}/omv/imlib/integral_mw.c               
  ${PROJECT_DIR}/omv/imlib/jpeg.c                      
  ${PROJECT_DIR}/omv/imlib/kmeans.c                    
  ${PROJECT_DIR}/omv/imlib/lab_tab.c                   
  ${PROJECT_DIR}/omv/imlib/lbp.c                       
  ${PROJECT_DIR}/omv/imlib/line.c                      
  ${PROJECT_DIR}/omv/imlib/lsd.c                       
  ${PROJECT_DIR}/omv/imlib/mathop.c                    
  ${PROJECT_DIR}/omv/imlib/mjpeg.c                     
  ${PROJECT_DIR}/omv/imlib/orb.c                       
  ${PROJECT_DIR}/omv/imlib/phasecorrelation.c          
  ${PROJECT_DIR}/omv/imlib/point.c                     
  ${PROJECT_DIR}/omv/imlib/pool.c                      
  ${PROJECT_DIR}/omv/imlib/ppm.c                       
  ${PROJECT_DIR}/omv/imlib/qrcode.c                    
  ${PROJECT_DIR}/omv/imlib/qsort.c                     
  ${PROJECT_DIR}/omv/imlib/rainbow_tab.c               
  ${PROJECT_DIR}/omv/imlib/rectangle.c                 
  ${PROJECT_DIR}/omv/imlib/selective_search.c          
  ${PROJECT_DIR}/omv/imlib/sincos_tab.c                
  ${PROJECT_DIR}/omv/imlib/stats.c                     
  ${PROJECT_DIR}/omv/imlib/template.c                  
  ${PROJECT_DIR}/omv/imlib/xyz_tab.c                   
  ${PROJECT_DIR}/omv/imlib/zbar.c
  
  ${PROJECT_DIR}/omv/ports/esp32s/sensor.c 
  ${PROJECT_DIR}/omv/ports/esp32s/arm_dsp_compat.c
)

set(OMV_MOD_SRCS
  ${PROJECT_DIR}/omv/modules/py_clock.c
  ${PROJECT_DIR}/omv/modules/py_gif.c  
  ${PROJECT_DIR}/omv/modules/py_helper.c
  ${PROJECT_DIR}/omv/modules/py_image.c
  ${PROJECT_DIR}/omv/modules/py_imageio.c
  ${PROJECT_DIR}/omv/modules/py_mjpeg.c
  ${PROJECT_DIR}/omv/modules/py_omv.c  
  ${PROJECT_DIR}/omv/modules/py_sensor.c
)

list(APPEND OMV_SRCS "${OMV_MOD_SRCS}")
if(CONFIG_USB_ENABLED)
list(APPEND OMV_SRCS ${PROJECT_DIR}/omv/common/usbdbg.c)
endif()

set(OMV_INCLUDEDIRS
  ${PROJECT_DIR}/omv
  ${PROJECT_DIR}/omv/alloc
  ${PROJECT_DIR}/omv/common
  ${PROJECT_DIR}/omv/imlib
  ${PROJECT_DIR}/omv/modules
  ${PROJECT_DIR}/omv/boards/esp32s
  ${MICROPY_DIR}/lib/oofatfs
)
endif()
