From 59f0fa1e5e6767602c346bdd9371bf7d6caa9d08 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 19 Apr 2021 13:30:04 +0700 Subject: [PATCH] cmake cleanup --- examples/device/audio_4_channel_mic/CMakeLists.txt | 2 +- examples/device/audio_test/CMakeLists.txt | 2 +- examples/device/board_test/CMakeLists.txt | 6 ++++-- examples/device/cdc_dual_ports/CMakeLists.txt | 2 +- examples/device/cdc_msc/CMakeLists.txt | 11 +++-------- examples/device/cdc_msc_freertos/CMakeLists.txt | 2 ++ examples/device/dfu_runtime/CMakeLists.txt | 2 +- examples/device/dynamic_configuration/CMakeLists.txt | 2 +- examples/device/hid_composite/CMakeLists.txt | 2 +- examples/device/hid_generic_inout/CMakeLists.txt | 2 +- examples/device/hid_multiple_interface/CMakeLists.txt | 2 +- examples/device/midi_test/CMakeLists.txt | 2 +- examples/device/msc_dual_lun/CMakeLists.txt | 2 +- examples/device/net_lwip_webserver/CMakeLists.txt | 2 +- examples/device/uac2_headset/CMakeLists.txt | 2 +- examples/device/usbtmc/CMakeLists.txt | 2 +- examples/device/webusb_serial/CMakeLists.txt | 2 +- examples/host/cdc_msc_hid/CMakeLists.txt | 2 +- 18 files changed, 24 insertions(+), 25 deletions(-) diff --git a/examples/device/audio_4_channel_mic/CMakeLists.txt b/examples/device/audio_4_channel_mic/CMakeLists.txt index 9cae652e..f2c81c4d 100644 --- a/examples/device/audio_4_channel_mic/CMakeLists.txt +++ b/examples/device/audio_4_channel_mic/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/audio_test/CMakeLists.txt b/examples/device/audio_test/CMakeLists.txt index 9cae652e..f2c81c4d 100644 --- a/examples/device/audio_test/CMakeLists.txt +++ b/examples/device/audio_test/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt index 698b0c96..c41ad92a 100644 --- a/examples/device/board_test/CMakeLists.txt +++ b/examples/device/board_test/CMakeLists.txt @@ -1,4 +1,6 @@ -# use directory name for project id +cmake_minimum_required(VERSION 3.5) + +# use BOARD-Directory name for project id get_filename_component(PROJECT ${CMAKE_CURRENT_SOURCE_DIR} NAME) set(PROJECT ${BOARD}-${PROJECT}) @@ -38,5 +40,5 @@ elseif(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/cdc_dual_ports/CMakeLists.txt b/examples/device/cdc_dual_ports/CMakeLists.txt index bb6416cc..4160c0c8 100644 --- a/examples/device/cdc_dual_ports/CMakeLists.txt +++ b/examples/device/cdc_dual_ports/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt index ca8f07ad..6c828a39 100644 --- a/examples/device/cdc_msc/CMakeLists.txt +++ b/examples/device/cdc_msc/CMakeLists.txt @@ -7,18 +7,13 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= -if(FAMILY MATCHES "^(esp32s[2-3])*") - cmake_minimum_required(VERSION 3.5) - include(${TOP}/hw/bsp/${FAMILY}/family.cmake) - project(${PROJECT}) - -elseif(FAMILY STREQUAL "rp2040") +if(FAMILY STREQUAL "rp2040") cmake_minimum_required(VERSION 3.12) include(${TOP}/hw/bsp/${FAMILY}/pico_sdk_import.cmake) project(${PROJECT}) add_executable(${PROJECT}) - + include(${TOP}/hw/bsp/${FAMILY}/family.cmake) # Example source @@ -39,5 +34,5 @@ elseif(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/cdc_msc_freertos/CMakeLists.txt b/examples/device/cdc_msc_freertos/CMakeLists.txt index aaac4d89..1d04a851 100644 --- a/examples/device/cdc_msc_freertos/CMakeLists.txt +++ b/examples/device/cdc_msc_freertos/CMakeLists.txt @@ -10,6 +10,8 @@ get_filename_component(TOP "${TOP}" REALPATH) # Check for -DFAMILY= if(FAMILY MATCHES "^esp32s[2-3]") + cmake_minimum_required(VERSION 3.5) + include(${TOP}/hw/bsp/${FAMILY}/family.cmake) project(${PROJECT}) diff --git a/examples/device/dfu_runtime/CMakeLists.txt b/examples/device/dfu_runtime/CMakeLists.txt index d59d2e9a..2bac7c32 100644 --- a/examples/device/dfu_runtime/CMakeLists.txt +++ b/examples/device/dfu_runtime/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/dynamic_configuration/CMakeLists.txt b/examples/device/dynamic_configuration/CMakeLists.txt index a9c34399..a99b755d 100644 --- a/examples/device/dynamic_configuration/CMakeLists.txt +++ b/examples/device/dynamic_configuration/CMakeLists.txt @@ -34,5 +34,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_composite/CMakeLists.txt b/examples/device/hid_composite/CMakeLists.txt index 7f85a3a4..3b677b3b 100644 --- a/examples/device/hid_composite/CMakeLists.txt +++ b/examples/device/hid_composite/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_generic_inout/CMakeLists.txt b/examples/device/hid_generic_inout/CMakeLists.txt index d59d2e9a..2bac7c32 100644 --- a/examples/device/hid_generic_inout/CMakeLists.txt +++ b/examples/device/hid_generic_inout/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/hid_multiple_interface/CMakeLists.txt b/examples/device/hid_multiple_interface/CMakeLists.txt index d59d2e9a..2bac7c32 100644 --- a/examples/device/hid_multiple_interface/CMakeLists.txt +++ b/examples/device/hid_multiple_interface/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/midi_test/CMakeLists.txt b/examples/device/midi_test/CMakeLists.txt index d59d2e9a..2bac7c32 100644 --- a/examples/device/midi_test/CMakeLists.txt +++ b/examples/device/midi_test/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/msc_dual_lun/CMakeLists.txt b/examples/device/msc_dual_lun/CMakeLists.txt index 454c5a08..8b472227 100644 --- a/examples/device/msc_dual_lun/CMakeLists.txt +++ b/examples/device/msc_dual_lun/CMakeLists.txt @@ -34,5 +34,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/net_lwip_webserver/CMakeLists.txt b/examples/device/net_lwip_webserver/CMakeLists.txt index 76f7be6c..4325b4ea 100644 --- a/examples/device/net_lwip_webserver/CMakeLists.txt +++ b/examples/device/net_lwip_webserver/CMakeLists.txt @@ -80,5 +80,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/uac2_headset/CMakeLists.txt b/examples/device/uac2_headset/CMakeLists.txt index d59d2e9a..2bac7c32 100644 --- a/examples/device/uac2_headset/CMakeLists.txt +++ b/examples/device/uac2_headset/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/usbtmc/CMakeLists.txt b/examples/device/usbtmc/CMakeLists.txt index f9ba2b52..c14595db 100644 --- a/examples/device/usbtmc/CMakeLists.txt +++ b/examples/device/usbtmc/CMakeLists.txt @@ -34,5 +34,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/device/webusb_serial/CMakeLists.txt b/examples/device/webusb_serial/CMakeLists.txt index d59d2e9a..2bac7c32 100644 --- a/examples/device/webusb_serial/CMakeLists.txt +++ b/examples/device/webusb_serial/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif() diff --git a/examples/host/cdc_msc_hid/CMakeLists.txt b/examples/host/cdc_msc_hid/CMakeLists.txt index 1b2be456..a9a4f08a 100644 --- a/examples/host/cdc_msc_hid/CMakeLists.txt +++ b/examples/host/cdc_msc_hid/CMakeLists.txt @@ -33,5 +33,5 @@ if(FAMILY STREQUAL "rp2040") ) else() - message(FATAL_ERROR "Invalid FAMILY specified") + message(FATAL_ERROR "Invalid FAMILY specified: ${FAMILY}") endif()