forked from CherryUSB/cherryusb_esp32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
111 lines (89 loc) · 3.26 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
idf_component_get_property(cusb_path leeebo__cherryusb COMPONENT_DIR)
set(srcs "additions/esp_cherryusb.c")
set(inc_dirs "additions" "${cusb_path}/common" "${cusb_path}/core")
# USB Device sources
if(CONFIG_CHERRYUSBD_ENABLED)
list(APPEND srcs
"${cusb_path}/core/usbd_core.c"
"${cusb_path}/port/dwc2/usb_dc_dwc2.c")
endif()
if(CONFIG_CHERRYUSBD_CDC_ENABLED)
list(APPEND srcs "${cusb_path}/class/cdc/usbd_cdc.c")
list(APPEND inc_dirs "${cusb_path}/class/cdc")
endif()
if(CONFIG_CHERRYUSBD_MSC_ENABLED)
list(APPEND srcs "${cusb_path}/class/msc/usbd_msc.c")
list(APPEND inc_dirs "${cusb_path}/class/msc")
endif()
if(CONFIG_CHERRYUSBD_HID_ENABLED)
list(APPEND srcs "${cusb_path}/class/hid/usbd_hid.c")
list(APPEND inc_dirs "${cusb_path}/class/hid")
endif()
if(CONFIG_CHERRYUSBD_AUDIO_ENABLED)
list(APPEND srcs "${cusb_path}/class/audio/usbd_audio.c")
list(APPEND inc_dirs "${cusb_path}/class/audio")
endif()
if(CONFIG_CHERRYUSBD_VIDEO_ENABLED)
list(APPEND srcs "${cusb_path}/class/video/usbd_video.c")
list(APPEND inc_dirs "${cusb_path}/class/video")
endif()
if(CONFIG_CHERRYUSBD_RNDIS_ENABLED)
list(APPEND srcs "${cusb_path}/class/rndis/usbd_rndis.c")
list(APPEND inc_dirs "${cusb_path}/class/rndis")
endif()
if(CONFIG_CHERRYUSBD_DFU_ENABLED)
list(APPEND srcs "${cusb_path}/class/dfu/usbd_dfu.c")
list(APPEND inc_dirs "${cusb_path}/class/dfu")
endif()
if(CONFIG_CHERRYUSBD_MTP_ENABLE)
list(APPEND srcs "${cusb_path}/class/mtp/usbd_mtp.c")
list(APPEND inc_dirs "${cusb_path}/class/mtp")
endif()
if(CONFIG_CHERRYUSBD_PRINTER_ENABLED)
list(APPEND srcs "${cusb_path}/class/printer/usbd_printer.c")
list(APPEND inc_dirs "${cusb_path}/class/printer")
endif()
# USB Host sources
if(CONFIG_CHERRYUSBH_ENABLED)
list(APPEND srcs
"${cusb_path}/core/usbh_core.c"
"${cusb_path}/port/dwc2/usb_hc_dwc2.c")
endif()
if(CONFIG_CHERRYUSBH_CDC_ENABLED)
list(APPEND srcs "${cusb_path}/class/cdc/usbh_cdc.c")
list(APPEND inc_dirs "${cusb_path}/class/cdc")
endif()
if(CONFIG_CHERRYUSBH_MSC_ENABLED)
list(APPEND srcs "${cusb_path}/class/msc/usbh_msc.c")
list(APPEND inc_dirs "${cusb_path}/class/msc")
endif()
if(CONFIG_CHERRYUSBH_HID_ENABLED)
list(APPEND srcs "${cusb_path}/class/hid/usbh_hid.c")
list(APPEND inc_dirs "${cusb_path}/class/hid")
endif()
if(CONFIG_CHERRYUSBH_AUDIO_ENABLED)
list(APPEND srcs "${cusb_path}/class/audio/usbh_audio.c")
list(APPEND inc_dirs "${cusb_path}/class/audio")
endif()
if(CONFIG_CHERRYUSBH_VIDEO_ENABLED)
list(APPEND srcs "${cusb_path}/class/video/usbh_video.c")
list(APPEND inc_dirs "${cusb_path}/class/video")
endif()
if(CONFIG_CHERRYUSBH_RNDIS_ENABLED)
list(APPEND srcs "${cusb_path}/class/rndis/usbh_rndis.c")
list(APPEND inc_dirs "${cusb_path}/class/rndis")
endif()
if(CONFIG_CHERRYUSBH_MTP_ENABLE)
list(APPEND srcs "${cusb_path}/class/mtp/usbh_mtp.c")
list(APPEND inc_dirs "${cusb_path}/class/mtp")
endif()
if(CONFIG_CHERRYUSBH_PRINTER_ENABLED)
list(APPEND srcs "${cusb_path}/class/printer/usbh_printer.c")
list(APPEND inc_dirs "${cusb_path}/class/printer")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${inc_dirs}
PRIV_REQUIRES usb
)
include(package_manager)
cu_pkg_define_version(${CMAKE_CURRENT_LIST_DIR})