Merge branch 'bugfix/cmake_component_path_v3.2' into 'release/v3.2'

cmake: Set COMPONENT_PATH during early expansion of dependencies (v3.2)

See merge request idf/esp-idf!4594
This commit is contained in:
Jiang Jiang Jian 2019-04-14 02:57:16 +08:00
commit c4f39094d3

View file

@ -161,9 +161,9 @@ function(expand_component_requirements component)
endif()
set_property(GLOBAL APPEND PROPERTY SEEN_COMPONENTS ${component})
find_component_path("${component}" "${ALL_COMPONENTS}" "${ALL_COMPONENT_PATHS}" component_path)
debug("Expanding dependencies of ${component} @ ${component_path}")
if(NOT component_path)
find_component_path("${component}" "${ALL_COMPONENTS}" "${ALL_COMPONENT_PATHS}" COMPONENT_PATH)
debug("Expanding dependencies of ${component} @ ${COMPONENT_PATH}")
if(NOT COMPONENT_PATH)
set_property(GLOBAL APPEND PROPERTY COMPONENTS_NOT_FOUND ${component})
return()
endif()
@ -173,7 +173,7 @@ function(expand_component_requirements component)
unset(COMPONENT_REQUIRES)
unset(COMPONENT_PRIV_REQUIRES)
set(COMPONENT ${component})
include(${component_path}/CMakeLists.txt)
include(${COMPONENT_PATH}/CMakeLists.txt)
get_property(requires GLOBAL PROPERTY "${component}_REQUIRES")
get_property(requires_priv GLOBAL PROPERTY "${component}_PRIV_REQUIRES")
@ -193,7 +193,7 @@ function(expand_component_requirements component)
endif()
# Now append this component to the full list (after its dependencies)
set_property(GLOBAL APPEND PROPERTY BUILD_COMPONENT_PATHS ${component_path})
set_property(GLOBAL APPEND PROPERTY BUILD_COMPONENT_PATHS ${COMPONENT_PATH})
set_property(GLOBAL APPEND PROPERTY BUILD_COMPONENTS ${component})
endfunction()