1
1
cmake_minimum_required (VERSION 3.13 )
2
- include (CMakePrintHelpers )
3
-
4
- # default toolchain is gcc
5
- if (NOT TOOLCHAIN )
6
- set (TOOLCHAIN "gcc" )
7
- endif ()
8
2
9
3
include (${CMAKE_CURRENT_SOURCE_DIR} /../../../hw/bsp/family_support.cmake )
10
4
@@ -16,54 +10,54 @@ project(${PROJECT} C CXX ASM)
16
10
# Checks this example is valid for the family and initializes the project
17
11
family_initialize_project (${PROJECT} ${CMAKE_CURRENT_LIST_DIR} )
18
12
19
- # Other family such as rp2040
20
- if (NOT FAMILY STREQUAL "espressif" )
21
- add_executable (${PROJECT} )
22
-
23
- # Example source
24
- target_sources (${PROJECT} PUBLIC
25
- ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
26
- )
13
+ # Espressif has its own cmake build system
14
+ if (FAMILY STREQUAL "espressif" )
15
+ return ()
16
+ endif ()
27
17
28
- # Example include
29
- target_include_directories (${PROJECT} PUBLIC
30
- ${CMAKE_CURRENT_SOURCE_DIR} /src
31
- )
18
+ add_executable (${PROJECT} )
32
19
33
- if (FAMILY STREQUAL "rp2040" )
34
- # Configure compilation flags and libraries for the example... see the corresponding function
35
- # in hw/bsp/FAMILY/family.cmake for details.
36
- family_configure_device_example (${PROJECT} )
37
- else ()
38
- # TOP is absolute path to root directory of TinyUSB git repo
39
- set (TOP "${CMAKE_CURRENT_LIST_DIR} /../../.." )
40
- get_filename_component (TOP "${TOP} " REALPATH )
20
+ # Example source
21
+ target_sources (${PROJECT} PUBLIC
22
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
23
+ )
41
24
42
- # re-include family.cmake
43
- include (${TOP} /hw/bsp/${FAMILY}/family.cmake )
25
+ # Example include
26
+ target_include_directories (${PROJECT} PUBLIC
27
+ ${CMAKE_CURRENT_SOURCE_DIR} /src
28
+ )
44
29
45
- target_sources (${PROJECT} PUBLIC
46
- ${TOP} /src/device/usbd.c
47
- ${TOP} /src/device/usbd_control.c
48
- ${TOP} /src/class/audio/audio_device.c
49
- ${TOP} /src/class/cdc/cdc_device.c
50
- ${TOP} /src/class/dfu/dfu_device.c
51
- ${TOP} /src/class/dfu/dfu_rt_device.c
52
- ${TOP} /src/class/hid/hid_device.c
53
- ${TOP} /src/class/midi/midi_device.c
54
- ${TOP} /src/class/msc/msc_device.c
55
- ${TOP} /src/class/net/ecm_rndis_device.c
56
- ${TOP} /src/class/net/ncm_device.c
57
- ${TOP} /src/class/usbtmc/usbtmc_device.c
58
- ${TOP} /src/class/vendor/vendor_device.c
59
- ${TOP} /src/class/video/video_device.c
60
- )
30
+ if (FAMILY STREQUAL "rp2040" )
31
+ # Configure compilation flags and libraries for the example... see the corresponding function
32
+ # in hw/bsp/FAMILY/family.cmake for details.
33
+ family_configure_device_example (${PROJECT} )
34
+ else ()
35
+ # TOP is absolute path to root directory of TinyUSB git repo
36
+ set (TOP "${CMAKE_CURRENT_LIST_DIR} /../../.." )
37
+ get_filename_component (TOP "${TOP} " REALPATH )
61
38
62
- target_include_directories (${PROJECT} PUBLIC
63
- ${TOP} /hw
64
- ${TOP} /src
65
- )
39
+ # re-include family.cmake
40
+ include (${TOP} /hw/bsp/${FAMILY}/family.cmake )
66
41
42
+ target_sources (${PROJECT} PUBLIC
43
+ ${TOP} /src/device/usbd.c
44
+ ${TOP} /src/device/usbd_control.c
45
+ ${TOP} /src/class/audio/audio_device.c
46
+ ${TOP} /src/class/cdc/cdc_device.c
47
+ ${TOP} /src/class/dfu/dfu_device.c
48
+ ${TOP} /src/class/dfu/dfu_rt_device.c
49
+ ${TOP} /src/class/hid/hid_device.c
50
+ ${TOP} /src/class/midi/midi_device.c
51
+ ${TOP} /src/class/msc/msc_device.c
52
+ ${TOP} /src/class/net/ecm_rndis_device.c
53
+ ${TOP} /src/class/net/ncm_device.c
54
+ ${TOP} /src/class/usbtmc/usbtmc_device.c
55
+ ${TOP} /src/class/vendor/vendor_device.c
56
+ ${TOP} /src/class/video/video_device.c
57
+ )
67
58
68
- endif ()
69
- endif ()
59
+ target_include_directories (${PROJECT} PUBLIC
60
+ ${TOP} /hw
61
+ ${TOP} /src
62
+ )
63
+ endif ()
0 commit comments