Skip to content

Commit f15f79d

Browse files
committed
cmake work well with imxrt
1 parent cda5ab8 commit f15f79d

File tree

14 files changed

+163
-162
lines changed

14 files changed

+163
-162
lines changed

examples/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 3.5)
33
#set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
44
include(${CMAKE_CURRENT_SOURCE_DIR}/../hw/bsp/family_support.cmake)
55

6-
project(tinyusb_examples)
6+
project(tinyusb_examples C CXX ASM)
77

88
add_subdirectory(device)
9-
add_subdirectory(dual)
10-
add_subdirectory(host)
9+
#add_subdirectory(dual)
10+
#add_subdirectory(host)

examples/device/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5)
22

33
include(${CMAKE_CURRENT_SOURCE_DIR}/../../hw/bsp/family_support.cmake)
44

5-
project(tinyusb_device_examples)
5+
project(tinyusb_device_examples C CXX ASM)
66
family_initialize_project(tinyusb_device_examples ${CMAKE_CURRENT_LIST_DIR})
77

88
# family_add_subdirectory will filter what to actually add based on selected FAMILY

examples/device/audio_test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ add_executable(${PROJECT})
2121
target_sources(${PROJECT} PUBLIC
2222
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
2323
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
24-
)
24+
)
2525

2626
# Example include
2727
target_include_directories(${PROJECT} PUBLIC
2828
${CMAKE_CURRENT_SOURCE_DIR}/src
29-
)
29+
)
3030

3131
# Configure compilation flags and libraries for the example... see the corresponding function
3232
# in hw/bsp/FAMILY/family.cmake for details.

examples/device/audio_test_multi_rate/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ add_executable(${PROJECT})
2121
target_sources(${PROJECT} PUBLIC
2222
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
2323
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
24-
)
24+
)
2525

2626
# Example include
2727
target_include_directories(${PROJECT} PUBLIC
2828
${CMAKE_CURRENT_SOURCE_DIR}/src
29-
)
29+
)
3030

3131
# Configure compilation flags and libraries for the example... see the corresponding function
3232
# in hw/bsp/FAMILY/family.cmake for details.

examples/device/board_test/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ add_executable(${PROJECT})
1919

2020
# Example source
2121
target_sources(${PROJECT} PUBLIC
22-
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23-
)
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23+
)
2424

2525
# Example include
2626
target_include_directories(${PROJECT} PUBLIC
27-
${CMAKE_CURRENT_SOURCE_DIR}/src
28-
)
27+
${CMAKE_CURRENT_SOURCE_DIR}/src
28+
)
2929

3030
# Configure compilation flags and libraries for the example... see the corresponding function
3131
# in hw/bsp/FAMILY/family.cmake for details.

examples/device/cdc_dual_ports/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ add_executable(${PROJECT})
1919

2020
# Example source
2121
target_sources(${PROJECT} PUBLIC
22-
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23-
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
24-
)
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
24+
)
2525

2626
# Example include
2727
target_include_directories(${PROJECT} PUBLIC
28-
${CMAKE_CURRENT_SOURCE_DIR}/src
29-
)
28+
${CMAKE_CURRENT_SOURCE_DIR}/src
29+
)
3030

3131
# Configure compilation flags and libraries for the example... see the corresponding function
3232
# in hw/bsp/FAMILY/family.cmake for details.

examples/device/cdc_msc/CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,13 @@ add_executable(${PROJECT})
1919

2020
# Example source
2121
target_sources(${PROJECT} PUBLIC
22-
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23-
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
24-
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
25-
)
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/msc_disk.c
24+
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
25+
)
2626

2727
# Example include
2828
target_include_directories(${PROJECT} PUBLIC
29-
${CMAKE_CURRENT_SOURCE_DIR}/src
30-
)
31-
32-
# define tinyusb_config target
33-
add_library(tinyusb_config INTERFACE)
34-
35-
target_include_directories(tinyusb_config INTERFACE
3629
${CMAKE_CURRENT_SOURCE_DIR}/src
3730
)
3831

examples/device/cdc_msc_freertos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ target_include_directories(${PROJECT} PUBLIC
3535
family_configure_device_example(${PROJECT})
3636

3737
if (NOT TARGET freertos_kernel)
38-
family_add_freertos_config(${PROJECT})
38+
family_configure_freertos_example(${PROJECT})
3939
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/FreeRTOS-Kernel lib/FreeRTOS-Kernel)
4040
endif()
4141

examples/device/hid_composite_freertos/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ target_include_directories(${PROJECT} PUBLIC
3434
family_configure_device_example(${PROJECT})
3535

3636
if (NOT TARGET freertos_kernel)
37-
family_add_freertos_config(${PROJECT})
37+
family_configure_freertos_example(${PROJECT})
3838
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/FreeRTOS-Kernel lib/FreeRTOS-Kernel)
3939
endif()
4040

examples/host/cdc_msc_hid/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
55
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
66
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
77

8-
project(${PROJECT})
8+
project(${PROJECT} C CXX ASM)
99

1010
# Checks this example is valid for the family and initializes the project
1111
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

0 commit comments

Comments
 (0)