summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-01-23 18:09:57 +0700
committerhathach <[email protected]>2021-01-23 18:09:57 +0700
commitcdd1c45306c21c3f7663742be5c9f7004572d595 (patch)
tree670115eac0ddff129527736f074c158353a3f5fd /examples
parent575b43e67dec85cdf58025806f3c993f80f70705 (diff)
improve ci for esp32s2
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_freertos/CMakeLists.txt15
-rw-r--r--examples/device/hid_composite_freertos/CMakeLists.txt15
2 files changed, 18 insertions, 12 deletions
diff --git a/examples/device/cdc_msc_freertos/CMakeLists.txt b/examples/device/cdc_msc_freertos/CMakeLists.txt
index 146b49cb0..2e55d8c47 100644
--- a/examples/device/cdc_msc_freertos/CMakeLists.txt
+++ b/examples/device/cdc_msc_freertos/CMakeLists.txt
@@ -1,15 +1,18 @@
-# The following five lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
+# use directory name for project id
+get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+
# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
-# Add example src and bsp directories
-set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2/boards" "${TOP}/hw/bsp/esp32s2/components")
+# Check for -DFAMILY=
+if(NOT DEFINED FAMILY)
+ message(FATAL_ERROR "Invalid FAMILY specified")
+endif()
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-set(SUPPORTED_TARGETS esp32s2)
+include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
+project(${PROJECT})
project(cdc_msc_freertos)
diff --git a/examples/device/hid_composite_freertos/CMakeLists.txt b/examples/device/hid_composite_freertos/CMakeLists.txt
index 3c48e4e70..c4777f122 100644
--- a/examples/device/hid_composite_freertos/CMakeLists.txt
+++ b/examples/device/hid_composite_freertos/CMakeLists.txt
@@ -1,15 +1,18 @@
-# The following five lines of boilerplate have to be in your project's
-# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
+# use directory name for project id
+get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+
# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "../../..")
get_filename_component(TOP "${TOP}" REALPATH)
-# Add example src and bsp directories
-set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2/boards" "${TOP}/hw/bsp/esp32s2/components")
+# Check for -DFAMILY=
+if(NOT DEFINED FAMILY)
+ message(FATAL_ERROR "Invalid FAMILY specified")
+endif()
-include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-set(SUPPORTED_TARGETS esp32s2)
+include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
+project(${PROJECT})
project(hid_composite_freertos)