Skip to content

Commit 3979677

Browse files
authored
Allow FetchContent usage in external projects (#1166)
1 parent dc25b2a commit 3979677

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
cmake_minimum_required(VERSION 3.15)
2+
cmake_minimum_required(VERSION 3.21)
33
cmake_policy(SET CMP0048 NEW) # project version
44
cmake_policy(SET CMP0076 NEW) # full paths
55

@@ -174,4 +174,6 @@ add_subdirectory(source)
174174
add_subdirectory(tools)
175175
add_subdirectory(test)
176176

177-
FetchContent_MakeAvailable(freertos_kernel cmock)
177+
if(PROJECT_IS_TOP_LEVEL)
178+
FetchContent_MakeAvailable(freertos_kernel cmock)
179+
endif()

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ FetchContent_Declare( freertos_plus_tcp
6060
- this particular example supports a native and cross-compiled build option.
6161

6262
```cmake
63-
set( FREERTOS_PLUS_FAT_DEV_SUPPORT OFF CACHE BOOL "" FORCE)
6463
# Select the native compile PORT
65-
set( FREERTOS_PLUS_FAT_PORT "POSIX" CACHE STRING "" FORCE)
66-
# Select the cross-compile PORT
64+
set( FREERTOS_PLUS_TCP_NETWORK_IF "POSIX" CACHE STRING "" FORCE)
65+
# Or: select a cross-compile PORT
6766
if (CMAKE_CROSSCOMPILING)
68-
# Eg. Zynq 2019_3 version of port
69-
set(FREERTOS_PLUS_FAT_PORT "ZYNQ_2019_3" CACHE STRING "" FORCE)
67+
# Eg. STM32Hxx version of port
68+
set(FREERTOS_PLUS_TCP_NETWORK_IF "STM32HXX" CACHE STRING "" FORCE)
7069
endif()
7170
7271
FetchContent_MakeAvailable(freertos_plus_tcp)

0 commit comments

Comments
 (0)