diff --git a/CMakeLists.txt b/CMakeLists.txt index 597cb3e57..f154ba25d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,19 @@ cmake_minimum_required(VERSION 3.12) -# Pull in SDK (must be before project) -include(pico_sdk_import.cmake) -include(pico_extras_import_optional.cmake) +if (NOT CMAKE_PROJECT_NAME) + # Pull in SDK (must be before project) + include(${CMAKE_CURRENT_LIST_DIR}/pico_sdk_import.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/pico_extras_import_optional.cmake) -project(pico_examples C CXX ASM) + pico_is_top_level_project(PICO_EXAMPLES_TOP_LEVEL_PROJECT) + + if (PICO_EXAMPLES_TOP_LEVEL_PROJECT) + project(pico_examples C CXX ASM) + else() + # Go back to individual example for project + return() + endif() +endif() set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) @@ -13,7 +22,7 @@ if (PICO_SDK_VERSION_STRING VERSION_LESS "2.1.0") message(FATAL_ERROR "Raspberry Pi Pico SDK version 2.1.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}") endif() -set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR}) +set(PICO_EXAMPLES_PATH ${CMAKE_CURRENT_LIST_DIR}) # If you want debug output from USB (pass -DPICO_STDIO_USB=1) this ensures you don't lose any debug output while USB is set up if (NOT DEFINED PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS) @@ -23,7 +32,7 @@ endif() # Initialize the SDK pico_sdk_init() -include(example_auto_set_url.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/example_auto_set_url.cmake) function(add_subdirectory_exclude_platforms NAME) if (ARGN) @@ -42,13 +51,6 @@ function(add_subdirectory_exclude_platforms NAME) add_subdirectory(${NAME}) endfunction() -# Add blink example -add_subdirectory_exclude_platforms(blink) -add_subdirectory_exclude_platforms(blink_simple) - -# Add hello world example -add_subdirectory_exclude_platforms(hello_world) - add_compile_options(-Wall -Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int -Wno-unused-function # we have some for the docs that aren't called @@ -57,34 +59,43 @@ if (CMAKE_C_COMPILER_ID STREQUAL "GNU") add_compile_options(-Wno-maybe-uninitialized) endif() -# Hardware-specific examples in subdirectories: -add_subdirectory(adc) -add_subdirectory(binary_info) -add_subdirectory(bootloaders) -add_subdirectory(clocks) -add_subdirectory(cmake) -add_subdirectory(dcp) -add_subdirectory(divider) -add_subdirectory(dma) -add_subdirectory(flash) -add_subdirectory(gpio) -add_subdirectory(hstx) -add_subdirectory(i2c) -add_subdirectory(interp) -add_subdirectory(multicore) -add_subdirectory(otp) -add_subdirectory(picoboard) -add_subdirectory(pico_w) -add_subdirectory(pio) -add_subdirectory(pwm) -add_subdirectory(reset) -add_subdirectory(rtc) -add_subdirectory(spi) -add_subdirectory(system) -add_subdirectory(timer) -add_subdirectory(uart) -add_subdirectory(universal) -add_subdirectory(usb) -add_subdirectory(watchdog) -add_subdirectory(sha) -add_subdirectory(freertos) +if (PICO_EXAMPLES_TOP_LEVEL_PROJECT) + # Add blink example + add_subdirectory_exclude_platforms(blink) + add_subdirectory_exclude_platforms(blink_simple) + + # Add hello world example + add_subdirectory_exclude_platforms(hello_world) + + # Hardware-specific examples in subdirectories: + add_subdirectory(adc) + add_subdirectory(binary_info) + add_subdirectory(bootloaders) + add_subdirectory(clocks) + add_subdirectory(cmake) + add_subdirectory(dcp) + add_subdirectory(divider) + add_subdirectory(dma) + add_subdirectory(flash) + add_subdirectory(gpio) + add_subdirectory(hstx) + add_subdirectory(i2c) + add_subdirectory(interp) + add_subdirectory(multicore) + add_subdirectory(otp) + add_subdirectory(picoboard) + add_subdirectory(pico_w) + add_subdirectory(pio) + add_subdirectory(pwm) + add_subdirectory(reset) + add_subdirectory(rtc) + add_subdirectory(spi) + add_subdirectory(system) + add_subdirectory(timer) + add_subdirectory(uart) + add_subdirectory(universal) + add_subdirectory(usb) + add_subdirectory(watchdog) + add_subdirectory(sha) + add_subdirectory(freertos) +endif() diff --git a/adc/adc_console/CMakeLists.txt b/adc/adc_console/CMakeLists.txt index 944a93d2d..cad5a27db 100644 --- a/adc/adc_console/CMakeLists.txt +++ b/adc/adc_console/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(adc_console C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(adc_console adc_console.c ) diff --git a/adc/dma_capture/CMakeLists.txt b/adc/dma_capture/CMakeLists.txt index ff965e9db..58573832b 100644 --- a/adc/dma_capture/CMakeLists.txt +++ b/adc/dma_capture/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(dma_capture C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(adc_dma_capture dma_capture.c ) diff --git a/adc/hello_adc/CMakeLists.txt b/adc/hello_adc/CMakeLists.txt index 186318246..47b898fe4 100644 --- a/adc/hello_adc/CMakeLists.txt +++ b/adc/hello_adc/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_adc C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_adc hello_adc.c ) diff --git a/adc/joystick_display/CMakeLists.txt b/adc/joystick_display/CMakeLists.txt index 96bb475ad..ff7aa37eb 100644 --- a/adc/joystick_display/CMakeLists.txt +++ b/adc/joystick_display/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(joystick_display C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(joystick_display joystick_display.c ) diff --git a/adc/microphone_adc/CMakeLists.txt b/adc/microphone_adc/CMakeLists.txt index 87f2c4029..6f7282515 100644 --- a/adc/microphone_adc/CMakeLists.txt +++ b/adc/microphone_adc/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(microphone_adc C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(microphone_adc microphone_adc.c ) diff --git a/adc/onboard_temperature/CMakeLists.txt b/adc/onboard_temperature/CMakeLists.txt index 1557ed234..464dd0c48 100644 --- a/adc/onboard_temperature/CMakeLists.txt +++ b/adc/onboard_temperature/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(onboard_temperature C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(onboard_temperature onboard_temperature.c) target_link_libraries(onboard_temperature pico_stdlib hardware_adc) diff --git a/adc/read_vsys/CMakeLists.txt b/adc/read_vsys/CMakeLists.txt index 67535bd72..404d701e2 100644 --- a/adc/read_vsys/CMakeLists.txt +++ b/adc/read_vsys/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(read_vsys C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_library(power_status_adc INTERFACE) target_sources(power_status_adc INTERFACE ${CMAKE_CURRENT_LIST_DIR}/power_status.c diff --git a/binary_info/blink_any/CMakeLists.txt b/binary_info/blink_any/CMakeLists.txt index de0401993..df21f0747 100644 --- a/binary_info/blink_any/CMakeLists.txt +++ b/binary_info/blink_any/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(blink_any C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (NOT PICO_CYW43_SUPPORTED) message("Only building blink_any for non W boards as PICO_CYW43_SUPPORTED is not set") endif() diff --git a/binary_info/hello_anything/CMakeLists.txt b/binary_info/hello_anything/CMakeLists.txt index 13aa84380..91d49f54b 100644 --- a/binary_info/hello_anything/CMakeLists.txt +++ b/binary_info/hello_anything/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_anything C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (TARGET tinyusb_device) add_executable(hello_anything hello_anything.c diff --git a/blink/CMakeLists.txt b/blink/CMakeLists.txt index 6308572d4..dba6bd516 100644 --- a/blink/CMakeLists.txt +++ b/blink/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../CMakeLists.txt) + project(blink C CXX ASM) + include(../CMakeLists.txt) +endif() + add_executable(blink blink.c ) diff --git a/blink_simple/CMakeLists.txt b/blink_simple/CMakeLists.txt index 0d7c0cb44..a26946099 100644 --- a/blink_simple/CMakeLists.txt +++ b/blink_simple/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../CMakeLists.txt) + project(blink_simple C CXX ASM) + include(../CMakeLists.txt) +endif() + add_executable(blink_simple blink_simple.c ) diff --git a/bootloaders/encrypted/CMakeLists.txt b/bootloaders/encrypted/CMakeLists.txt index f29f0efe2..ce4b8a4c8 100644 --- a/bootloaders/encrypted/CMakeLists.txt +++ b/bootloaders/encrypted/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(encrypted C CXX ASM) + include(../../CMakeLists.txt) +endif() + # Encrypted Bootloader add_executable(enc_bootloader enc_bootloader.c diff --git a/clocks/detached_clk_peri/CMakeLists.txt b/clocks/detached_clk_peri/CMakeLists.txt index d3dc75e01..1f5389af2 100644 --- a/clocks/detached_clk_peri/CMakeLists.txt +++ b/clocks/detached_clk_peri/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(detached_clk_peri C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(clocks_detached_clk_peri detached_clk_peri.c ) diff --git a/clocks/hello_48MHz/CMakeLists.txt b/clocks/hello_48MHz/CMakeLists.txt index 3ca96fc52..d51edd770 100644 --- a/clocks/hello_48MHz/CMakeLists.txt +++ b/clocks/hello_48MHz/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_48MHz C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_48MHz hello_48MHz.c ) diff --git a/clocks/hello_gpout/CMakeLists.txt b/clocks/hello_gpout/CMakeLists.txt index 057ec3c5f..36297bf0d 100644 --- a/clocks/hello_gpout/CMakeLists.txt +++ b/clocks/hello_gpout/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_gpout C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_gpout hello_gpout.c ) diff --git a/clocks/hello_resus/CMakeLists.txt b/clocks/hello_resus/CMakeLists.txt index 9d4522e94..57ab28f78 100644 --- a/clocks/hello_resus/CMakeLists.txt +++ b/clocks/hello_resus/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_resus C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_resus hello_resus.c ) diff --git a/cmake/build_variants/CMakeLists.txt b/cmake/build_variants/CMakeLists.txt index f40f80625..fb5b7132d 100644 --- a/cmake/build_variants/CMakeLists.txt +++ b/cmake/build_variants/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(build_variants C CXX ASM) + include(../../CMakeLists.txt) +endif() + # 1 Create an INTERFACE library aggregating all the common parts of the application add_library(common_stuff INTERFACE) diff --git a/dcp/hello_dcp/CMakeLists.txt b/dcp/hello_dcp/CMakeLists.txt index 2235fb271..6e5167bda 100644 --- a/dcp/hello_dcp/CMakeLists.txt +++ b/dcp/hello_dcp/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_dcp C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_dcp hello_dcp.c dcp_examples.S diff --git a/divider/CMakeLists.txt b/divider/CMakeLists.txt index d5ad0ac8e..fd6a44b7b 100644 --- a/divider/CMakeLists.txt +++ b/divider/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../CMakeLists.txt) + project(divider C CXX ASM) + include(../CMakeLists.txt) +endif() + if (TARGET hardware_divider) add_executable(hello_divider hello_divider.c diff --git a/dma/channel_irq/CMakeLists.txt b/dma/channel_irq/CMakeLists.txt index 25dc64e20..36b481fbf 100644 --- a/dma/channel_irq/CMakeLists.txt +++ b/dma/channel_irq/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(channel_irq C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(dma_channel_irq channel_irq.c ) diff --git a/dma/control_blocks/CMakeLists.txt b/dma/control_blocks/CMakeLists.txt index b551c7bfe..a39ccf5e4 100644 --- a/dma/control_blocks/CMakeLists.txt +++ b/dma/control_blocks/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(control_blocks C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(dma_control_blocks control_blocks.c ) diff --git a/dma/hello_dma/CMakeLists.txt b/dma/hello_dma/CMakeLists.txt index b513a2eb8..8950dbab5 100644 --- a/dma/hello_dma/CMakeLists.txt +++ b/dma/hello_dma/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_dma C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_dma hello_dma.c ) diff --git a/dma/sniff_crc/CMakeLists.txt b/dma/sniff_crc/CMakeLists.txt index 6f72b5100..8da26fa47 100644 --- a/dma/sniff_crc/CMakeLists.txt +++ b/dma/sniff_crc/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(sniff_crc C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(sniff_crc sniff_crc.c ) diff --git a/flash/cache_perfctr/CMakeLists.txt b/flash/cache_perfctr/CMakeLists.txt index 2d065a28e..ab18b694e 100644 --- a/flash/cache_perfctr/CMakeLists.txt +++ b/flash/cache_perfctr/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(cache_perfctr C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(flash_cache_perfctr flash_cache_perfctr.c ) diff --git a/flash/nuke/CMakeLists.txt b/flash/nuke/CMakeLists.txt index c8ae47a94..0c84368de 100644 --- a/flash/nuke/CMakeLists.txt +++ b/flash/nuke/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(nuke C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(flash_nuke nuke.c ) diff --git a/flash/program/CMakeLists.txt b/flash/program/CMakeLists.txt index a17bb0ec0..00b7e41c4 100644 --- a/flash/program/CMakeLists.txt +++ b/flash/program/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(program C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(flash_program flash_program.c ) diff --git a/flash/runtime_flash_permissions/CMakeLists.txt b/flash/runtime_flash_permissions/CMakeLists.txt index 3eb6bdd94..1b27ff336 100644 --- a/flash/runtime_flash_permissions/CMakeLists.txt +++ b/flash/runtime_flash_permissions/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(runtime_flash_permissions C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(runtime_flash_permissions runtime_flash_permissions.c ) diff --git a/flash/ssi_dma/CMakeLists.txt b/flash/ssi_dma/CMakeLists.txt index 965cc6098..c2d3d98d7 100644 --- a/flash/ssi_dma/CMakeLists.txt +++ b/flash/ssi_dma/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(ssi_dma C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(flash_ssi_dma flash_ssi_dma.c ) diff --git a/flash/xip_stream/CMakeLists.txt b/flash/xip_stream/CMakeLists.txt index bd8b6dd03..ff7e5b6d2 100644 --- a/flash/xip_stream/CMakeLists.txt +++ b/flash/xip_stream/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(xip_stream C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(flash_xip_stream flash_xip_stream.c ) diff --git a/freertos/hello_freertos/CMakeLists.txt b/freertos/hello_freertos/CMakeLists.txt index 1da0ce773..d1f7e556a 100644 --- a/freertos/hello_freertos/CMakeLists.txt +++ b/freertos/hello_freertos/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_freertos C CXX ASM) + include(../../CMakeLists.txt) +endif() + set(TARGET_NAME hello_freertos1) add_executable(${TARGET_NAME} hello_freertos.c diff --git a/gpio/dht_sensor/CMakeLists.txt b/gpio/dht_sensor/CMakeLists.txt index 33c72ea99..302469cfd 100644 --- a/gpio/dht_sensor/CMakeLists.txt +++ b/gpio/dht_sensor/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(dht_sensor C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(dht dht.c ) diff --git a/gpio/hello_7segment/CMakeLists.txt b/gpio/hello_7segment/CMakeLists.txt index d0ce3aecf..e24fd9d70 100644 --- a/gpio/hello_7segment/CMakeLists.txt +++ b/gpio/hello_7segment/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_7segment C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_7segment hello_7segment.c ) diff --git a/gpio/hello_gpio_irq/CMakeLists.txt b/gpio/hello_gpio_irq/CMakeLists.txt index e514cfbea..5bd7ffe16 100644 --- a/gpio/hello_gpio_irq/CMakeLists.txt +++ b/gpio/hello_gpio_irq/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_gpio_irq C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_gpio_irq hello_gpio_irq.c ) diff --git a/hello_world/serial/CMakeLists.txt b/hello_world/serial/CMakeLists.txt index 7be690122..ca99bd5a2 100644 --- a/hello_world/serial/CMakeLists.txt +++ b/hello_world/serial/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(serial C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_serial hello_serial.c ) diff --git a/hello_world/usb/CMakeLists.txt b/hello_world/usb/CMakeLists.txt index aa176eb93..3a0c43126 100644 --- a/hello_world/usb/CMakeLists.txt +++ b/hello_world/usb/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(usb C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (TARGET tinyusb_device) add_executable(hello_usb hello_usb.c diff --git a/hstx/dvi_out_hstx_encoder/CMakeLists.txt b/hstx/dvi_out_hstx_encoder/CMakeLists.txt index 4c9b3a345..a6875b455 100644 --- a/hstx/dvi_out_hstx_encoder/CMakeLists.txt +++ b/hstx/dvi_out_hstx_encoder/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(dvi_out_hstx_encoder C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(dvi_out_hstx_encoder dvi_out_hstx_encoder.c ) diff --git a/hstx/spi_lcd/CMakeLists.txt b/hstx/spi_lcd/CMakeLists.txt index 7d8551ac0..5f76b5330 100644 --- a/hstx/spi_lcd/CMakeLists.txt +++ b/hstx/spi_lcd/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(spi_lcd C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hstx_spi_lcd hstx_spi_lcd.c ) diff --git a/i2c/bmp280_i2c/CMakeLists.txt b/i2c/bmp280_i2c/CMakeLists.txt index c63a7baba..4ac64f2b8 100644 --- a/i2c/bmp280_i2c/CMakeLists.txt +++ b/i2c/bmp280_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(bmp280_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(bmp280_i2c bmp280_i2c.c ) diff --git a/i2c/bus_scan/CMakeLists.txt b/i2c/bus_scan/CMakeLists.txt index 662cfe61b..a808e0a34 100644 --- a/i2c/bus_scan/CMakeLists.txt +++ b/i2c/bus_scan/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(bus_scan C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(i2c_bus_scan bus_scan.c ) diff --git a/i2c/ht16k33_i2c/CMakeLists.txt b/i2c/ht16k33_i2c/CMakeLists.txt index b9b1110fb..567bdebab 100644 --- a/i2c/ht16k33_i2c/CMakeLists.txt +++ b/i2c/ht16k33_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(ht16k33_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(ht16k33_i2c ht16k33_i2c.c ) diff --git a/i2c/lcd_1602_i2c/CMakeLists.txt b/i2c/lcd_1602_i2c/CMakeLists.txt index c6aad7ae1..5a2f0318c 100644 --- a/i2c/lcd_1602_i2c/CMakeLists.txt +++ b/i2c/lcd_1602_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(lcd_1602_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(lcd_1602_i2c lcd_1602_i2c.c ) diff --git a/i2c/lis3dh_i2c/CMakeLists.txt b/i2c/lis3dh_i2c/CMakeLists.txt index 0b23c9043..b60d4d5d4 100644 --- a/i2c/lis3dh_i2c/CMakeLists.txt +++ b/i2c/lis3dh_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(lis3dh_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(lis3dh_i2c lis3dh_i2c.c ) diff --git a/i2c/mcp9808_i2c/CMakeLists.txt b/i2c/mcp9808_i2c/CMakeLists.txt index 4ee1b4975..754c4226c 100644 --- a/i2c/mcp9808_i2c/CMakeLists.txt +++ b/i2c/mcp9808_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(mcp9808_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(mcp9808_i2c mcp9808_i2c.c ) diff --git a/i2c/mma8451_i2c/CMakeLists.txt b/i2c/mma8451_i2c/CMakeLists.txt index e3c1084d1..e570d9567 100644 --- a/i2c/mma8451_i2c/CMakeLists.txt +++ b/i2c/mma8451_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(mma8451_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(mma8451_i2c mma8451_i2c.c ) diff --git a/i2c/mpl3115a2_i2c/CMakeLists.txt b/i2c/mpl3115a2_i2c/CMakeLists.txt index db9a5d7b6..62a54af2a 100644 --- a/i2c/mpl3115a2_i2c/CMakeLists.txt +++ b/i2c/mpl3115a2_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(mpl3115a2_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(mpl3115a2_i2c mpl3115a2_i2c.c ) diff --git a/i2c/mpu6050_i2c/CMakeLists.txt b/i2c/mpu6050_i2c/CMakeLists.txt index 83be3d51e..0f981b1b6 100644 --- a/i2c/mpu6050_i2c/CMakeLists.txt +++ b/i2c/mpu6050_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(mpu6050_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(mpu6050_i2c mpu6050_i2c.c ) diff --git a/i2c/pa1010d_i2c/CMakeLists.txt b/i2c/pa1010d_i2c/CMakeLists.txt index b04fac23f..60e6555b0 100644 --- a/i2c/pa1010d_i2c/CMakeLists.txt +++ b/i2c/pa1010d_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(pa1010d_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pa1010d_i2c pa1010d_i2c.c ) diff --git a/i2c/pcf8523_i2c/CMakeLists.txt b/i2c/pcf8523_i2c/CMakeLists.txt index 8d47635b3..4279fa82f 100644 --- a/i2c/pcf8523_i2c/CMakeLists.txt +++ b/i2c/pcf8523_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(pcf8523_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pcf8523_i2c pcf8523_i2c.c ) diff --git a/i2c/slave_mem_i2c/CMakeLists.txt b/i2c/slave_mem_i2c/CMakeLists.txt index 449744447..c8ea02cb1 100644 --- a/i2c/slave_mem_i2c/CMakeLists.txt +++ b/i2c/slave_mem_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(slave_mem_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(slave_mem_i2c slave_mem_i2c.c ) diff --git a/i2c/ssd1306_i2c/CMakeLists.txt b/i2c/ssd1306_i2c/CMakeLists.txt index 25fabace1..fde9d06d5 100644 --- a/i2c/ssd1306_i2c/CMakeLists.txt +++ b/i2c/ssd1306_i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(ssd1306_i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(ssd1306_i2c ssd1306_i2c.c ) diff --git a/interp/hello_interp/CMakeLists.txt b/interp/hello_interp/CMakeLists.txt index 05b176da7..5eff3426b 100644 --- a/interp/hello_interp/CMakeLists.txt +++ b/interp/hello_interp/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_interp C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (TARGET hardware_interp) add_executable(hello_interp hello_interp.c diff --git a/multicore/hello_multicore/CMakeLists.txt b/multicore/hello_multicore/CMakeLists.txt index 540d67948..a124eb5b1 100644 --- a/multicore/hello_multicore/CMakeLists.txt +++ b/multicore/hello_multicore/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_multicore C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_multicore multicore.c ) diff --git a/multicore/multicore_doorbell/CMakeLists.txt b/multicore/multicore_doorbell/CMakeLists.txt index 8e2493e18..5f3147cbd 100644 --- a/multicore/multicore_doorbell/CMakeLists.txt +++ b/multicore/multicore_doorbell/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(multicore_doorbell C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(multicore_doorbell multicore_doorbell.c ) diff --git a/multicore/multicore_fifo_irqs/CMakeLists.txt b/multicore/multicore_fifo_irqs/CMakeLists.txt index aa1097e14..fc2d1e22b 100644 --- a/multicore/multicore_fifo_irqs/CMakeLists.txt +++ b/multicore/multicore_fifo_irqs/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(multicore_fifo_irqs C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(multicore_fifo_irqs multicore_fifo_irqs.c ) diff --git a/multicore/multicore_runner/CMakeLists.txt b/multicore/multicore_runner/CMakeLists.txt index a96db31e0..d36df9010 100644 --- a/multicore/multicore_runner/CMakeLists.txt +++ b/multicore/multicore_runner/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(multicore_runner C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(multicore_runner multicore_runner.c ) diff --git a/multicore/multicore_runner_queue/CMakeLists.txt b/multicore/multicore_runner_queue/CMakeLists.txt index c35368a78..cde9bcfb3 100644 --- a/multicore/multicore_runner_queue/CMakeLists.txt +++ b/multicore/multicore_runner_queue/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(multicore_runner_queue C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(multicore_runner_queue multicore_runner_queue.c ) diff --git a/otp/hello_otp/CMakeLists.txt b/otp/hello_otp/CMakeLists.txt index 43397cd3e..b52be6a81 100644 --- a/otp/hello_otp/CMakeLists.txt +++ b/otp/hello_otp/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_otp C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_otp hello_otp.c ) diff --git a/pico_w/bt/CMakeLists.txt b/pico_w/bt/CMakeLists.txt index e14345398..954080892 100644 --- a/pico_w/bt/CMakeLists.txt +++ b/pico_w/bt/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(bt C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_subdirectory(standalone) set(BTSTACK_ROOT ${PICO_SDK_PATH}/lib/btstack) diff --git a/pico_w/bt/standalone/CMakeLists.txt b/pico_w/bt/standalone/CMakeLists.txt index 28d20b687..87f278362 100644 --- a/pico_w/bt/standalone/CMakeLists.txt +++ b/pico_w/bt/standalone/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(standalone C CXX ASM) + include(../../../CMakeLists.txt) +endif() + # Standalone example that reads from the on board temperature sensor and sends notifications via BLE # Flashes slowly each second to show it's running add_executable(picow_ble_temp_sensor diff --git a/pico_w/wifi/access_point/CMakeLists.txt b/pico_w/wifi/access_point/CMakeLists.txt index 6bc0a2eb4..77d1676ce 100644 --- a/pico_w/wifi/access_point/CMakeLists.txt +++ b/pico_w/wifi/access_point/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(access_point C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_access_point_background picow_access_point.c dhcpserver/dhcpserver.c diff --git a/pico_w/wifi/blink/CMakeLists.txt b/pico_w/wifi/blink/CMakeLists.txt index 2b1e6bfd3..60661477e 100644 --- a/pico_w/wifi/blink/CMakeLists.txt +++ b/pico_w/wifi/blink/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(blink C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_blink picow_blink.c ) diff --git a/pico_w/wifi/freertos/http_client/CMakeLists.txt b/pico_w/wifi/freertos/http_client/CMakeLists.txt index 2010621a9..aa18264dc 100644 --- a/pico_w/wifi/freertos/http_client/CMakeLists.txt +++ b/pico_w/wifi/freertos/http_client/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../../CMakeLists.txt) + project(http_client C CXX ASM) + include(../../../../CMakeLists.txt) +endif() + # This example is disabled as mbedtls uses too much stack, and Freertos SMP is problematic with # pico_cyw43_arch_lwip_threadsafe_background (nosys), where WiFi and LwIP activity is performed in an IRQ. # Prefer to use pico_cyw43_arch_lwip_sys_freertos instead, where WiFi and LwIP activity is performed in a thread. diff --git a/pico_w/wifi/freertos/httpd/CMakeLists.txt b/pico_w/wifi/freertos/httpd/CMakeLists.txt index 35dd4eb35..2f34f4362 100644 --- a/pico_w/wifi/freertos/httpd/CMakeLists.txt +++ b/pico_w/wifi/freertos/httpd/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../../CMakeLists.txt) + project(httpd C CXX ASM) + include(../../../../CMakeLists.txt) +endif() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}) add_executable(pico_freertos_httpd_nosys diff --git a/pico_w/wifi/freertos/iperf/CMakeLists.txt b/pico_w/wifi/freertos/iperf/CMakeLists.txt index 2cc17c560..7e4259de5 100644 --- a/pico_w/wifi/freertos/iperf/CMakeLists.txt +++ b/pico_w/wifi/freertos/iperf/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../../CMakeLists.txt) + project(iperf C CXX ASM) + include(../../../../CMakeLists.txt) +endif() + add_executable(picow_freertos_iperf_server_nosys picow_freertos_iperf.c ) diff --git a/pico_w/wifi/freertos/ntp_client_socket/CMakeLists.txt b/pico_w/wifi/freertos/ntp_client_socket/CMakeLists.txt index 3cb02d5f1..5a0a0a394 100644 --- a/pico_w/wifi/freertos/ntp_client_socket/CMakeLists.txt +++ b/pico_w/wifi/freertos/ntp_client_socket/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../../CMakeLists.txt) + project(ntp_client_socket C CXX ASM) + include(../../../../CMakeLists.txt) +endif() + add_executable(picow_freertos_ntp_client_socket picow_freertos_ntp_client_socket.c ) diff --git a/pico_w/wifi/freertos/ping/CMakeLists.txt b/pico_w/wifi/freertos/ping/CMakeLists.txt index 1296e09bf..debcdba16 100644 --- a/pico_w/wifi/freertos/ping/CMakeLists.txt +++ b/pico_w/wifi/freertos/ping/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../../CMakeLists.txt) + project(ping C CXX ASM) + include(../../../../CMakeLists.txt) +endif() + if (EXISTS ${PICO_LWIP_CONTRIB_PATH}/apps/ping/ping.c) add_executable(picow_freertos_ping_nosys picow_freertos_ping.c diff --git a/pico_w/wifi/http_client/CMakeLists.txt b/pico_w/wifi/http_client/CMakeLists.txt index a1be39398..50f73f36c 100644 --- a/pico_w/wifi/http_client/CMakeLists.txt +++ b/pico_w/wifi/http_client/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(http_client C CXX ASM) + include(../../../CMakeLists.txt) +endif() + pico_add_library(example_lwip_http_util NOFLAG) target_sources(example_lwip_http_util INTERFACE ${CMAKE_CURRENT_LIST_DIR}/example_http_client_util.c diff --git a/pico_w/wifi/httpd/CMakeLists.txt b/pico_w/wifi/httpd/CMakeLists.txt index f028ef6dd..4c4401114 100644 --- a/pico_w/wifi/httpd/CMakeLists.txt +++ b/pico_w/wifi/httpd/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(httpd C CXX ASM) + include(../../../CMakeLists.txt) +endif() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}) add_executable(picow_httpd_background diff --git a/pico_w/wifi/iperf/CMakeLists.txt b/pico_w/wifi/iperf/CMakeLists.txt index 56a6a1b0a..bc1f86b89 100644 --- a/pico_w/wifi/iperf/CMakeLists.txt +++ b/pico_w/wifi/iperf/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(iperf C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_iperf_server_background picow_iperf.c ) diff --git a/pico_w/wifi/ntp_client/CMakeLists.txt b/pico_w/wifi/ntp_client/CMakeLists.txt index 22a2e6354..0067a6be7 100644 --- a/pico_w/wifi/ntp_client/CMakeLists.txt +++ b/pico_w/wifi/ntp_client/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(ntp_client C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_ntp_client_background picow_ntp_client.c ) diff --git a/pico_w/wifi/tcp_client/CMakeLists.txt b/pico_w/wifi/tcp_client/CMakeLists.txt index 0bb498a5c..cc4bec906 100644 --- a/pico_w/wifi/tcp_client/CMakeLists.txt +++ b/pico_w/wifi/tcp_client/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(tcp_client C CXX ASM) + include(../../../CMakeLists.txt) +endif() + if (NOT TEST_TCP_SERVER_IP) message("Skipping tcp_client example as TEST_TCP_SERVER_IP is not defined") else() diff --git a/pico_w/wifi/tcp_server/CMakeLists.txt b/pico_w/wifi/tcp_server/CMakeLists.txt index 3e8a48471..b90e192f4 100644 --- a/pico_w/wifi/tcp_server/CMakeLists.txt +++ b/pico_w/wifi/tcp_server/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(tcp_server C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_tcpip_server_background picow_tcp_server.c ) diff --git a/pico_w/wifi/tls_client/CMakeLists.txt b/pico_w/wifi/tls_client/CMakeLists.txt index fdbe6c056..9f65fffe7 100644 --- a/pico_w/wifi/tls_client/CMakeLists.txt +++ b/pico_w/wifi/tls_client/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(tls_client C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_tls_client_background picow_tls_client.c tls_common.c diff --git a/pico_w/wifi/udp_beacon/CMakeLists.txt b/pico_w/wifi/udp_beacon/CMakeLists.txt index 59300eee4..5fc913943 100644 --- a/pico_w/wifi/udp_beacon/CMakeLists.txt +++ b/pico_w/wifi/udp_beacon/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(udp_beacon C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_udp_beacon_background picow_udp_beacon.c ) diff --git a/pico_w/wifi/wifi_scan/CMakeLists.txt b/pico_w/wifi/wifi_scan/CMakeLists.txt index ba0cd4f97..ab755413d 100644 --- a/pico_w/wifi/wifi_scan/CMakeLists.txt +++ b/pico_w/wifi/wifi_scan/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(wifi_scan C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(picow_wifi_scan_background picow_wifi_scan.c ) diff --git a/picoboard/blinky/CMakeLists.txt b/picoboard/blinky/CMakeLists.txt index e3e57abc7..51f0915d4 100644 --- a/picoboard/blinky/CMakeLists.txt +++ b/picoboard/blinky/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(blinky C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(picoboard_blinky blinky.c ) diff --git a/picoboard/button/CMakeLists.txt b/picoboard/button/CMakeLists.txt index c3ef5d726..66ee07fef 100644 --- a/picoboard/button/CMakeLists.txt +++ b/picoboard/button/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(button C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(picoboard_button button.c ) diff --git a/pio/addition/CMakeLists.txt b/pio/addition/CMakeLists.txt index 9ff90779e..f01bcdaad 100644 --- a/pio/addition/CMakeLists.txt +++ b/pio/addition/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(addition C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_addition) pico_generate_pio_header(pio_addition ${CMAKE_CURRENT_LIST_DIR}/addition.pio) diff --git a/pio/apa102/CMakeLists.txt b/pio/apa102/CMakeLists.txt index 1522f5564..4721e40ba 100644 --- a/pio/apa102/CMakeLists.txt +++ b/pio/apa102/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(apa102 C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_apa102) pico_generate_pio_header(pio_apa102 ${CMAKE_CURRENT_LIST_DIR}/apa102.pio) diff --git a/pio/clocked_input/CMakeLists.txt b/pio/clocked_input/CMakeLists.txt index cd71408a3..9a0b7b2da 100644 --- a/pio/clocked_input/CMakeLists.txt +++ b/pio/clocked_input/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(clocked_input C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_clocked_input) pico_generate_pio_header(pio_clocked_input ${CMAKE_CURRENT_LIST_DIR}/clocked_input.pio) diff --git a/pio/differential_manchester/CMakeLists.txt b/pio/differential_manchester/CMakeLists.txt index 6276f09f5..0725bcbef 100644 --- a/pio/differential_manchester/CMakeLists.txt +++ b/pio/differential_manchester/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(differential_manchester C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_differential_manchester) pico_generate_pio_header(pio_differential_manchester ${CMAKE_CURRENT_LIST_DIR}/differential_manchester.pio) diff --git a/pio/hello_pio/CMakeLists.txt b/pio/hello_pio/CMakeLists.txt index 1c1d67496..e10bf1a29 100644 --- a/pio/hello_pio/CMakeLists.txt +++ b/pio/hello_pio/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_pio C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_pio) pico_generate_pio_header(hello_pio ${CMAKE_CURRENT_LIST_DIR}/hello.pio) diff --git a/pio/hub75/CMakeLists.txt b/pio/hub75/CMakeLists.txt index a976f4eab..0cd6d7643 100644 --- a/pio/hub75/CMakeLists.txt +++ b/pio/hub75/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hub75 C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_hub75) pico_generate_pio_header(pio_hub75 ${CMAKE_CURRENT_LIST_DIR}/hub75.pio) diff --git a/pio/i2c/CMakeLists.txt b/pio/i2c/CMakeLists.txt index d49b22482..05e7a423f 100644 --- a/pio/i2c/CMakeLists.txt +++ b/pio/i2c/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(i2c C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_i2c_bus_scan) pico_generate_pio_header(pio_i2c_bus_scan ${CMAKE_CURRENT_LIST_DIR}/i2c.pio) diff --git a/pio/ir_nec/ir_loopback/CMakeLists.txt b/pio/ir_nec/ir_loopback/CMakeLists.txt index 8c7d8f4b7..c84ef8d99 100644 --- a/pio/ir_nec/ir_loopback/CMakeLists.txt +++ b/pio/ir_nec/ir_loopback/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(ir_loopback C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable (pio_ir_loopback ir_loopback.c) # link the executable using the IR transmit and receive libraries diff --git a/pio/logic_analyser/CMakeLists.txt b/pio/logic_analyser/CMakeLists.txt index 8a65198a9..1e78df9ae 100644 --- a/pio/logic_analyser/CMakeLists.txt +++ b/pio/logic_analyser/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(logic_analyser C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_logic_analyser) target_sources(pio_logic_analyser PRIVATE logic_analyser.c) diff --git a/pio/manchester_encoding/CMakeLists.txt b/pio/manchester_encoding/CMakeLists.txt index 70b88283a..4c165cfa2 100644 --- a/pio/manchester_encoding/CMakeLists.txt +++ b/pio/manchester_encoding/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(manchester_encoding C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_manchester_encoding) pico_generate_pio_header(pio_manchester_encoding ${CMAKE_CURRENT_LIST_DIR}/manchester_encoding.pio) diff --git a/pio/onewire/CMakeLists.txt b/pio/onewire/CMakeLists.txt index 4090cb36c..aca566dc2 100644 --- a/pio/onewire/CMakeLists.txt +++ b/pio/onewire/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(onewire C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_onewire) target_sources(pio_onewire PRIVATE onewire.c) diff --git a/pio/pio_blink/CMakeLists.txt b/pio/pio_blink/CMakeLists.txt index 88b5584fd..f9c961fa3 100644 --- a/pio/pio_blink/CMakeLists.txt +++ b/pio/pio_blink/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(pio_blink C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_blink) # by default the header is generated into the build dir diff --git a/pio/pwm/CMakeLists.txt b/pio/pwm/CMakeLists.txt index 7c6f2fc01..506f32670 100644 --- a/pio/pwm/CMakeLists.txt +++ b/pio/pwm/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(pwm C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_pwm) pico_generate_pio_header(pio_pwm ${CMAKE_CURRENT_LIST_DIR}/pwm.pio) diff --git a/pio/quadrature_encoder/CMakeLists.txt b/pio/quadrature_encoder/CMakeLists.txt index b118f3c27..6b59240cf 100644 --- a/pio/quadrature_encoder/CMakeLists.txt +++ b/pio/quadrature_encoder/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(quadrature_encoder C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_quadrature_encoder) pico_generate_pio_header(pio_quadrature_encoder ${CMAKE_CURRENT_LIST_DIR}/quadrature_encoder.pio) diff --git a/pio/quadrature_encoder_substep/CMakeLists.txt b/pio/quadrature_encoder_substep/CMakeLists.txt index 7bc7f6a0a..abebad841 100644 --- a/pio/quadrature_encoder_substep/CMakeLists.txt +++ b/pio/quadrature_encoder_substep/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(quadrature_encoder_substep C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_quadrature_encoder_substep) pico_generate_pio_header(pio_quadrature_encoder_substep ${CMAKE_CURRENT_LIST_DIR}/quadrature_encoder_substep.pio) diff --git a/pio/spi/CMakeLists.txt b/pio/spi/CMakeLists.txt index 44c561a85..d413abb51 100644 --- a/pio/spi/CMakeLists.txt +++ b/pio/spi/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(spi C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_spi_flash) pico_generate_pio_header(pio_spi_flash ${CMAKE_CURRENT_LIST_DIR}/spi.pio) diff --git a/pio/squarewave/CMakeLists.txt b/pio/squarewave/CMakeLists.txt index fe503bb1d..6e4795c14 100644 --- a/pio/squarewave/CMakeLists.txt +++ b/pio/squarewave/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(squarewave C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_squarewave) pico_generate_pio_header(pio_squarewave ${CMAKE_CURRENT_LIST_DIR}/squarewave.pio) diff --git a/pio/st7789_lcd/CMakeLists.txt b/pio/st7789_lcd/CMakeLists.txt index a6243e646..996b92274 100644 --- a/pio/st7789_lcd/CMakeLists.txt +++ b/pio/st7789_lcd/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(st7789_lcd C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_st7789_lcd) pico_generate_pio_header(pio_st7789_lcd ${CMAKE_CURRENT_LIST_DIR}/st7789_lcd.pio) diff --git a/pio/uart_rx/CMakeLists.txt b/pio/uart_rx/CMakeLists.txt index 5f985e1bb..a9069ad6b 100644 --- a/pio/uart_rx/CMakeLists.txt +++ b/pio/uart_rx/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(uart_rx C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_uart_rx) pico_generate_pio_header(pio_uart_rx ${CMAKE_CURRENT_LIST_DIR}/uart_rx.pio) diff --git a/pio/uart_tx/CMakeLists.txt b/pio/uart_tx/CMakeLists.txt index 5e3cf2a82..c54a6b543 100644 --- a/pio/uart_tx/CMakeLists.txt +++ b/pio/uart_tx/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(uart_tx C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_uart_tx) pico_generate_pio_header(pio_uart_tx ${CMAKE_CURRENT_LIST_DIR}/uart_tx.pio) diff --git a/pio/ws2812/CMakeLists.txt b/pio/ws2812/CMakeLists.txt index 3e887b908..94baddf4f 100644 --- a/pio/ws2812/CMakeLists.txt +++ b/pio/ws2812/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(ws2812 C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pio_ws2812) file(MAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/generated) diff --git a/pwm/hello_pwm/CMakeLists.txt b/pwm/hello_pwm/CMakeLists.txt index e2df80ceb..6a9796517 100644 --- a/pwm/hello_pwm/CMakeLists.txt +++ b/pwm/hello_pwm/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_pwm C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_pwm hello_pwm.c ) diff --git a/pwm/led_fade/CMakeLists.txt b/pwm/led_fade/CMakeLists.txt index a9f5eea56..874aaa918 100644 --- a/pwm/led_fade/CMakeLists.txt +++ b/pwm/led_fade/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(led_fade C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pwm_led_fade pwm_led_fade.c ) diff --git a/pwm/measure_duty_cycle/CMakeLists.txt b/pwm/measure_duty_cycle/CMakeLists.txt index 45bd4d623..8be5b92f7 100644 --- a/pwm/measure_duty_cycle/CMakeLists.txt +++ b/pwm/measure_duty_cycle/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(measure_duty_cycle C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(pwm_measure_duty_cycle measure_duty_cycle.c ) diff --git a/reset/hello_reset/CMakeLists.txt b/reset/hello_reset/CMakeLists.txt index fc0854377..192bf0ed5 100644 --- a/reset/hello_reset/CMakeLists.txt +++ b/reset/hello_reset/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_reset C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (TARGET hardware_resets) add_executable(hello_reset hello_reset.c diff --git a/rtc/hello_rtc/CMakeLists.txt b/rtc/hello_rtc/CMakeLists.txt index b3cc1a25c..a7f106a48 100644 --- a/rtc/hello_rtc/CMakeLists.txt +++ b/rtc/hello_rtc/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_rtc C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_rtc hello_rtc.c ) diff --git a/rtc/rtc_alarm/CMakeLists.txt b/rtc/rtc_alarm/CMakeLists.txt index 8f0dfa2cb..b5952b5ab 100644 --- a/rtc/rtc_alarm/CMakeLists.txt +++ b/rtc/rtc_alarm/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(rtc_alarm C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(rtc_alarm rtc_alarm.c ) diff --git a/rtc/rtc_alarm_repeat/CMakeLists.txt b/rtc/rtc_alarm_repeat/CMakeLists.txt index bd3c9e3e0..abaa12f05 100644 --- a/rtc/rtc_alarm_repeat/CMakeLists.txt +++ b/rtc/rtc_alarm_repeat/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(rtc_alarm_repeat C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(rtc_alarm_repeat rtc_alarm_repeat.c ) diff --git a/sha/mbedtls_sha256/CMakeLists.txt b/sha/mbedtls_sha256/CMakeLists.txt index a9bec5d18..96f1ababa 100644 --- a/sha/mbedtls_sha256/CMakeLists.txt +++ b/sha/mbedtls_sha256/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(mbedtls_sha256 C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (NOT TARGET hardware_sha256) return() endif() diff --git a/sha/sha256/CMakeLists.txt b/sha/sha256/CMakeLists.txt index 5835fe863..55d5108aa 100644 --- a/sha/sha256/CMakeLists.txt +++ b/sha/sha256/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(sha256 C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (NOT TARGET hardware_sha256) return() endif() diff --git a/spi/bme280_spi/CMakeLists.txt b/spi/bme280_spi/CMakeLists.txt index 117d01a51..d0646afc5 100644 --- a/spi/bme280_spi/CMakeLists.txt +++ b/spi/bme280_spi/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(bme280_spi C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(bme280_spi bme280_spi.c ) diff --git a/spi/max7219_32x8_spi/CMakeLists.txt b/spi/max7219_32x8_spi/CMakeLists.txt index 415eb33f3..2bb83127b 100644 --- a/spi/max7219_32x8_spi/CMakeLists.txt +++ b/spi/max7219_32x8_spi/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(max7219_32x8_spi C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(max7219_32x8_spi max7219_32x8_spi.c ) diff --git a/spi/max7219_8x7seg_spi/CMakeLists.txt b/spi/max7219_8x7seg_spi/CMakeLists.txt index ab0b08c12..c3255dad4 100644 --- a/spi/max7219_8x7seg_spi/CMakeLists.txt +++ b/spi/max7219_8x7seg_spi/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(max7219_8x7seg_spi C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(max7219_8x7seg_spi max7219_8x7seg_spi.c ) diff --git a/spi/mpu9250_spi/CMakeLists.txt b/spi/mpu9250_spi/CMakeLists.txt index 5e0a6120a..cc907c35c 100644 --- a/spi/mpu9250_spi/CMakeLists.txt +++ b/spi/mpu9250_spi/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(mpu9250_spi C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(mpu9250_spi mpu9250_spi.c ) diff --git a/spi/spi_dma/CMakeLists.txt b/spi/spi_dma/CMakeLists.txt index 3adfdda60..a4a1bef5e 100644 --- a/spi/spi_dma/CMakeLists.txt +++ b/spi/spi_dma/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(spi_dma C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(spi_dma spi_dma.c ) diff --git a/spi/spi_flash/CMakeLists.txt b/spi/spi_flash/CMakeLists.txt index 2a0ddcc35..a5e534293 100644 --- a/spi/spi_flash/CMakeLists.txt +++ b/spi/spi_flash/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(spi_flash C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(spi_flash spi_flash.c ) diff --git a/spi/spi_master_slave/spi_master/CMakeLists.txt b/spi/spi_master_slave/spi_master/CMakeLists.txt index 534e78fd6..8a74737f5 100644 --- a/spi/spi_master_slave/spi_master/CMakeLists.txt +++ b/spi/spi_master_slave/spi_master/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(spi_master C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(spi_master spi_master.c ) diff --git a/spi/spi_master_slave/spi_slave/CMakeLists.txt b/spi/spi_master_slave/spi_slave/CMakeLists.txt index 8e0564506..b1ed04089 100644 --- a/spi/spi_master_slave/spi_slave/CMakeLists.txt +++ b/spi/spi_master_slave/spi_slave/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(spi_slave C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(spi_slave spi_slave.c ) diff --git a/system/boot_info/CMakeLists.txt b/system/boot_info/CMakeLists.txt index ec166f968..752472c07 100644 --- a/system/boot_info/CMakeLists.txt +++ b/system/boot_info/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(boot_info C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(boot_info boot_info.c ) diff --git a/system/hello_double_tap/CMakeLists.txt b/system/hello_double_tap/CMakeLists.txt index 30a9e12f7..eeed3b78f 100644 --- a/system/hello_double_tap/CMakeLists.txt +++ b/system/hello_double_tap/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_double_tap C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_double_tap hello_double_tap.c ) diff --git a/system/narrow_io_write/CMakeLists.txt b/system/narrow_io_write/CMakeLists.txt index 5e57819d7..a13cce156 100644 --- a/system/narrow_io_write/CMakeLists.txt +++ b/system/narrow_io_write/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(narrow_io_write C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(narrow_io_write narrow_io_write.c ) diff --git a/system/rand/CMakeLists.txt b/system/rand/CMakeLists.txt index f874c9f78..dc9334780 100644 --- a/system/rand/CMakeLists.txt +++ b/system/rand/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(rand C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(rand rand.c ) diff --git a/system/unique_board_id/CMakeLists.txt b/system/unique_board_id/CMakeLists.txt index 1a5b1f989..e80648f17 100644 --- a/system/unique_board_id/CMakeLists.txt +++ b/system/unique_board_id/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(unique_board_id C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(unique_board_id unique_board_id.c ) diff --git a/timer/hello_timer/CMakeLists.txt b/timer/hello_timer/CMakeLists.txt index 806cf699f..30eacc0ad 100644 --- a/timer/hello_timer/CMakeLists.txt +++ b/timer/hello_timer/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_timer C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_timer hello_timer.c ) diff --git a/timer/periodic_sampler/CMakeLists.txt b/timer/periodic_sampler/CMakeLists.txt index 284780fb3..d5f8af67a 100644 --- a/timer/periodic_sampler/CMakeLists.txt +++ b/timer/periodic_sampler/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(periodic_sampler C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (NOT PICO_TIME_NO_ALARM_SUPPORT) add_executable(periodic_sampler periodic_sampler.c diff --git a/timer/timer_lowlevel/CMakeLists.txt b/timer/timer_lowlevel/CMakeLists.txt index 55d4e82aa..3cee215dd 100644 --- a/timer/timer_lowlevel/CMakeLists.txt +++ b/timer/timer_lowlevel/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(timer_lowlevel C CXX ASM) + include(../../CMakeLists.txt) +endif() + if (PICO_ON_DEVICE) add_executable(timer_lowlevel timer_lowlevel.c) diff --git a/uart/hello_uart/CMakeLists.txt b/uart/hello_uart/CMakeLists.txt index 0931f384d..d072dd550 100644 --- a/uart/hello_uart/CMakeLists.txt +++ b/uart/hello_uart/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_uart C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_uart hello_uart.c ) diff --git a/uart/lcd_uart/CMakeLists.txt b/uart/lcd_uart/CMakeLists.txt index 64098821f..a82f9a472 100644 --- a/uart/lcd_uart/CMakeLists.txt +++ b/uart/lcd_uart/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(lcd_uart C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(lcd_uart lcd_uart.c ) diff --git a/uart/uart_advanced/CMakeLists.txt b/uart/uart_advanced/CMakeLists.txt index a7cf5638e..fdf1cb569 100644 --- a/uart/uart_advanced/CMakeLists.txt +++ b/uart/uart_advanced/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(uart_advanced C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(uart_advanced uart_advanced.c ) diff --git a/universal/hello_universal/CMakeLists.txt b/universal/hello_universal/CMakeLists.txt index 51269beac..00dbde3e6 100644 --- a/universal/hello_universal/CMakeLists.txt +++ b/universal/hello_universal/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_universal C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_universal hello_universal.c ) diff --git a/usb/device/dev_hid_composite/CMakeLists.txt b/usb/device/dev_hid_composite/CMakeLists.txt index cd035d9a5..e0abfc849 100644 --- a/usb/device/dev_hid_composite/CMakeLists.txt +++ b/usb/device/dev_hid_composite/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(dev_hid_composite C CXX ASM) + include(../../../CMakeLists.txt) +endif() + cmake_minimum_required(VERSION 3.13) add_executable(dev_hid_composite) diff --git a/usb/device/dev_lowlevel/CMakeLists.txt b/usb/device/dev_lowlevel/CMakeLists.txt index 906c84e5f..d751400c1 100644 --- a/usb/device/dev_lowlevel/CMakeLists.txt +++ b/usb/device/dev_lowlevel/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(dev_lowlevel C CXX ASM) + include(../../../CMakeLists.txt) +endif() + add_executable(dev_lowlevel dev_lowlevel.c ) diff --git a/usb/host/host_cdc_msc_hid/CMakeLists.txt b/usb/host/host_cdc_msc_hid/CMakeLists.txt index 55f5a4a98..385201219 100644 --- a/usb/host/host_cdc_msc_hid/CMakeLists.txt +++ b/usb/host/host_cdc_msc_hid/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../../CMakeLists.txt) + project(host_cdc_msc_hid C CXX ASM) + include(../../../CMakeLists.txt) +endif() + cmake_minimum_required(VERSION 3.13) add_executable(host_cdc_msc_hid) diff --git a/watchdog/hello_watchdog/CMakeLists.txt b/watchdog/hello_watchdog/CMakeLists.txt index 9e1e5d006..c6340863a 100644 --- a/watchdog/hello_watchdog/CMakeLists.txt +++ b/watchdog/hello_watchdog/CMakeLists.txt @@ -1,3 +1,11 @@ +cmake_minimum_required(VERSION 3.12) + +if (NOT CMAKE_PROJECT_NAME) + include(../../CMakeLists.txt) + project(hello_watchdog C CXX ASM) + include(../../CMakeLists.txt) +endif() + add_executable(hello_watchdog hello_watchdog.c )