Skip to content

Commit 5287c01

Browse files
phelterpaulbartell
authored andcommitted
Supporting backwards compatibility with FREERTOS_CONFIG_FILE_DIRECTORY (#571)
1 parent f6b7bd6 commit 5287c01

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

CMakeLists.txt

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,36 @@ cmake_minimum_required(VERSION 3.15)
1313

1414
# `freertos_config` target defines the path to FreeRTOSConfig.h and optionally other freertos based config files
1515
if(NOT TARGET freertos_config )
16-
message(FATAL_ERROR " freertos_config target not specified. Please specify a cmake target that defines the include directory for FreeRTOSConfig.h:\n"
17-
" add_library(freertos_config INTERFACE)\n"
18-
" target_include_directories(freertos_config SYSTEM\n"
19-
" INTERFACE\n"
20-
" include) # The config file directory\n"
21-
" target_compile_definitions(freertos_config\n"
22-
" PUBLIC\n"
23-
" projCOVERAGE_TEST=0)\n")
16+
if (NOT DEFINED FREERTOS_CONFIG_FILE_DIRECTORY )
17+
18+
message(FATAL_ERROR " freertos_config target not specified. Please specify a cmake target that defines the include directory for FreeRTOSConfig.h:\n"
19+
" add_library(freertos_config INTERFACE)\n"
20+
" target_include_directories(freertos_config SYSTEM\n"
21+
" INTERFACE\n"
22+
" include) # The config file directory\n"
23+
" target_compile_definitions(freertos_config\n"
24+
" PUBLIC\n"
25+
" projCOVERAGE_TEST=0)\n")
26+
else()
27+
message(WARNING " Using deprecated 'FREERTOS_CONFIG_FILE_DIRECTORY' - please update your project CMakeLists.txt file:\n"
28+
" add_library(freertos_config INTERFACE)\n"
29+
" target_include_directories(freertos_config SYSTEM\n"
30+
" INTERFACE\n"
31+
" include) # The config file directory\n"
32+
" target_compile_definitions(freertos_config\n"
33+
" PUBLIC\n"
34+
" projCOVERAGE_TEST=0)\n")
35+
# Currently will add this in here.
36+
add_library(freertos_config INTERFACE)
37+
target_include_directories(freertos_config SYSTEM
38+
INTERFACE
39+
${FREERTOS_CONFIG_FILE_DIRECTORY}
40+
)
41+
target_compile_definitions(freertos_config
42+
PUBLIC
43+
projCOVERAGE_TEST=0
44+
)
45+
endif()
2446
endif()
2547

2648
# Heap number or absolute path to custom heap implementation provided by user

0 commit comments

Comments
 (0)