From 05360d003f28b1eebfe6b5bfa0a5dacc6b676e46 Mon Sep 17 00:00:00 2001 From: Nico van Duijn Date: Mon, 1 Jul 2024 16:54:58 +0200 Subject: [PATCH] Allow FetchContent usage in external projects --- CMakeLists.txt | 4 +++- README.md | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 426937904..75c51f957 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,4 +174,6 @@ add_subdirectory(source) add_subdirectory(tools) add_subdirectory(test) -FetchContent_MakeAvailable(freertos_kernel cmock) +if(NOT FREERTOS_PLUS_TCP_USE_LOCAL_FREERTOS) + FetchContent_MakeAvailable(freertos_kernel cmock) +endif() \ No newline at end of file diff --git a/README.md b/README.md index 4832106f5..b607952a7 100644 --- a/README.md +++ b/README.md @@ -60,18 +60,20 @@ FetchContent_Declare( freertos_plus_tcp - this particular example supports a native and cross-compiled build option. ```cmake -set( FREERTOS_PLUS_FAT_DEV_SUPPORT OFF CACHE BOOL "" FORCE) # Select the native compile PORT -set( FREERTOS_PLUS_FAT_PORT "POSIX" CACHE STRING "" FORCE) -# Select the cross-compile PORT +set( FREERTOS_PLUS_TCP_NETWORK_IF "POSIX" CACHE STRING "" FORCE) +# Or: select a cross-compile PORT if (CMAKE_CROSSCOMPILING) - # Eg. Zynq 2019_3 version of port - set(FREERTOS_PLUS_FAT_PORT "ZYNQ_2019_3" CACHE STRING "" FORCE) + # Eg. STM32Hxx version of port + set(FREERTOS_PLUS_TCP_NETWORK_IF "STM32HXX" CACHE STRING "" FORCE) endif() FetchContent_MakeAvailable(freertos_plus_tcp) ``` +If you already have FreeRTOS in your project, you may skip the fetch content by setting +`FREERTOS_PLUS_TCP_USE_LOCAL_FREERTOS` to `ON`. + ### Consuming stand-alone This repository uses [Git Submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to bring in dependent components.