Skip to content

Commit 6daa135

Browse files
committed
update most examples cmake to build with imxrt
1 parent 0afe1b3 commit 6daa135

File tree

17 files changed

+107
-36
lines changed

17 files changed

+107
-36
lines changed

examples/device/audio_4_channel_mic/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
1212

13+
# Espressif has its own cmake build system
14+
if(FAMILY STREQUAL "espressif")
15+
return()
16+
endif()
17+
1318
add_executable(${PROJECT})
1419

1520
# Example source
1621
target_sources(${PROJECT} PUBLIC
1722
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
1823
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
19-
)
24+
)
2025

2126
# Example include
2227
target_include_directories(${PROJECT} PUBLIC
2328
${CMAKE_CURRENT_SOURCE_DIR}/src
24-
)
29+
)
2530

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

examples/device/audio_test/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
1212

13+
# Espressif has its own cmake build system
14+
if(FAMILY STREQUAL "espressif")
15+
return()
16+
endif()
17+
1318
add_executable(${PROJECT})
1419

1520
# Example source

examples/device/audio_test_multi_rate/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
1212

13+
# Espressif has its own cmake build system
14+
if(FAMILY STREQUAL "espressif")
15+
return()
16+
endif()
17+
1318
add_executable(${PROJECT})
1419

1520
# Example source

examples/device/cdc_dual_ports/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
1212

13+
# Espressif has its own cmake build system
14+
if(FAMILY STREQUAL "espressif")
15+
return()
16+
endif()
17+
1318
add_executable(${PROJECT})
1419

1520
# Example source

examples/device/cdc_msc_freertos/CMakeLists.txt

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

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

examples/device/dfu/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
12+
# Espressif has its own cmake build system
13+
if(FAMILY STREQUAL "espressif")
14+
return()
15+
endif()
1216

1317
add_executable(${PROJECT})
1418

examples/device/dfu_runtime/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
12+
# Espressif has its own cmake build system
13+
if(FAMILY STREQUAL "espressif")
14+
return()
15+
endif()
1216

1317
add_executable(${PROJECT})
1418

examples/device/dynamic_configuration/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
12+
# Espressif has its own cmake build system
13+
if(FAMILY STREQUAL "espressif")
14+
return()
15+
endif()
1216

1317
add_executable(${PROJECT})
1418

examples/device/hid_boot_interface/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
12+
# Espressif has its own cmake build system
13+
if(FAMILY STREQUAL "espressif")
14+
return()
15+
endif()
1216

1317
add_executable(${PROJECT})
1418

examples/device/hid_composite/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
cmake_minimum_required(VERSION 3.5)
1+
cmake_minimum_required(VERSION 3.17)
22

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

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})
12+
# Espressif has its own cmake build system
13+
if(FAMILY STREQUAL "espressif")
14+
return()
15+
endif()
1216

1317
add_executable(${PROJECT})
1418

0 commit comments

Comments
 (0)