cmake: exclude dot-dirs from added components

This commit is contained in:
Renz Christian Bagaporo 2019-05-20 14:36:55 +08:00
parent 078c69e689
commit 5175a152d9
2 changed files with 10 additions and 2 deletions

View File

@ -147,7 +147,11 @@ function(__build_init idf_path)
file(GLOB component_dirs ${idf_path}/components/*)
foreach(component_dir ${component_dirs})
get_filename_component(component_dir ${component_dir} ABSOLUTE)
__component_add(${component_dir} ${prefix})
get_filename_component(base_dir ${component_dir} NAME)
string(SUBSTRING "${base_dir}" 0 1 first_char)
if(NOT first_char STREQUAL ".")
__component_add(${component_dir} ${prefix})
endif()
endforeach()
# Set components required by all other components in the build

View File

@ -148,7 +148,11 @@ function(__project_init components_var test_components_var)
file(GLOB component_dirs ${component_dir}/*)
foreach(component_dir ${component_dirs})
if(EXISTS ${component_dir}/CMakeLists.txt)
idf_build_component(${component_dir})
get_filename_component(base_dir ${component_dir} NAME)
string(SUBSTRING "${base_dir}" 0 1 first_char)
if(NOT first_char STREQUAL ".")
idf_build_component(${component_dir})
endif()
endif()
endforeach()
endif()