cmake: fix extra component dir ordering

This commit is contained in:
Renz Christian Bagaporo 2020-02-20 12:34:51 +05:00 committed by Renz Bagaporo
parent b40c7c78e3
commit 7f37fb81ca

View file

@ -217,18 +217,18 @@ function(__project_init components_var test_components_var)
"but component manager is not enabled. Please set IDF_COMPONENT_MANAGER environment variable.")
endif()
spaces2list(EXTRA_COMPONENT_DIRS)
foreach(component_dir ${EXTRA_COMPONENT_DIRS})
__project_component_dir("${component_dir}")
endforeach()
__project_component_dir("${CMAKE_CURRENT_LIST_DIR}/components")
# Look for components in the usual places: CMAKE_CURRENT_LIST_DIR/main,
# CMAKE_CURRENT_LIST_DIR/components, and the extra component dirs
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/main")
__project_component_dir("${CMAKE_CURRENT_LIST_DIR}/main")
endif()
__project_component_dir("${CMAKE_CURRENT_LIST_DIR}/components")
spaces2list(EXTRA_COMPONENT_DIRS)
foreach(component_dir ${EXTRA_COMPONENT_DIRS})
__project_component_dir("${component_dir}")
endforeach()
endif()
spaces2list(COMPONENTS)