mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
cmake: don't treat the readme file as a component
This commit is contained in:
parent
23a03a3bdb
commit
0f7b90d205
@ -150,10 +150,12 @@ function(__build_init idf_path)
|
|||||||
file(GLOB component_dirs ${idf_path}/components/*)
|
file(GLOB component_dirs ${idf_path}/components/*)
|
||||||
list(SORT component_dirs)
|
list(SORT component_dirs)
|
||||||
foreach(component_dir ${component_dirs})
|
foreach(component_dir ${component_dirs})
|
||||||
get_filename_component(component_dir ${component_dir} ABSOLUTE)
|
# A potential component must be a directory
|
||||||
__component_dir_quick_check(is_component ${component_dir})
|
if(IS_DIRECTORY ${component_dir})
|
||||||
if(is_component)
|
__component_dir_quick_check(is_component ${component_dir})
|
||||||
__component_add(${component_dir} ${prefix})
|
if(is_component)
|
||||||
|
__component_add(${component_dir} ${prefix})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
@ -97,16 +97,11 @@ function(__component_dir_quick_check var component_dir)
|
|||||||
set(res 1)
|
set(res 1)
|
||||||
get_filename_component(abs_dir ${component_dir} ABSOLUTE)
|
get_filename_component(abs_dir ${component_dir} ABSOLUTE)
|
||||||
|
|
||||||
# Check this is really a directory and that a CMakeLists.txt file for this component exists
|
|
||||||
# - warn and skip anything which isn't valid looking (probably cruft)
|
|
||||||
if(NOT IS_DIRECTORY "${abs_dir}")
|
|
||||||
message(STATUS "Unexpected file in components directory: ${abs_dir}")
|
|
||||||
set(res 0)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_filename_component(base_dir ${abs_dir} NAME)
|
get_filename_component(base_dir ${abs_dir} NAME)
|
||||||
string(SUBSTRING "${base_dir}" 0 1 first_char)
|
string(SUBSTRING "${base_dir}" 0 1 first_char)
|
||||||
|
|
||||||
|
# Check the component directory contains a CMakeLists.txt file
|
||||||
|
# - warn and skip anything which isn't valid looking (probably cruft)
|
||||||
if(NOT first_char STREQUAL ".")
|
if(NOT first_char STREQUAL ".")
|
||||||
if(NOT EXISTS "${abs_dir}/CMakeLists.txt")
|
if(NOT EXISTS "${abs_dir}/CMakeLists.txt")
|
||||||
message(STATUS "Component directory ${abs_dir} does not contain a CMakeLists.txt file. "
|
message(STATUS "Component directory ${abs_dir} does not contain a CMakeLists.txt file. "
|
||||||
|
@ -157,13 +157,14 @@ function(__project_init components_var test_components_var)
|
|||||||
|
|
||||||
function(__project_component_dir component_dir)
|
function(__project_component_dir component_dir)
|
||||||
get_filename_component(component_dir "${component_dir}" ABSOLUTE)
|
get_filename_component(component_dir "${component_dir}" ABSOLUTE)
|
||||||
|
# The directory itself is a valid idf component
|
||||||
if(EXISTS ${component_dir}/CMakeLists.txt)
|
if(EXISTS ${component_dir}/CMakeLists.txt)
|
||||||
idf_build_component(${component_dir})
|
idf_build_component(${component_dir})
|
||||||
else()
|
else()
|
||||||
|
# otherwise, check whether the subfolders are potential idf components
|
||||||
file(GLOB component_dirs ${component_dir}/*)
|
file(GLOB component_dirs ${component_dir}/*)
|
||||||
foreach(component_dir ${component_dirs})
|
foreach(component_dir ${component_dirs})
|
||||||
if(EXISTS ${component_dir}/CMakeLists.txt)
|
if(IS_DIRECTORY ${component_dir})
|
||||||
get_filename_component(base_dir ${component_dir} NAME)
|
|
||||||
__component_dir_quick_check(is_component ${component_dir})
|
__component_dir_quick_check(is_component ${component_dir})
|
||||||
if(is_component)
|
if(is_component)
|
||||||
idf_build_component(${component_dir})
|
idf_build_component(${component_dir})
|
||||||
@ -205,9 +206,11 @@ function(__project_init components_var test_components_var)
|
|||||||
file(GLOB bootloader_component_dirs "${CMAKE_CURRENT_LIST_DIR}/bootloader_components/*")
|
file(GLOB bootloader_component_dirs "${CMAKE_CURRENT_LIST_DIR}/bootloader_components/*")
|
||||||
list(SORT bootloader_component_dirs)
|
list(SORT bootloader_component_dirs)
|
||||||
foreach(bootloader_component_dir ${bootloader_component_dirs})
|
foreach(bootloader_component_dir ${bootloader_component_dirs})
|
||||||
__component_dir_quick_check(is_component ${bootloader_component_dir})
|
if(IS_DIRECTORY ${bootloader_component_dir})
|
||||||
if(is_component)
|
__component_dir_quick_check(is_component ${bootloader_component_dir})
|
||||||
__kconfig_bootloader_component_add("${bootloader_component_dir}")
|
if(is_component)
|
||||||
|
__kconfig_bootloader_component_add("${bootloader_component_dir}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user