mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: fix error in converting project variables to namespaced ones
Closes https://github.com/espressif/esp-idf/issues/2764
This commit is contained in:
parent
3bc970c5f4
commit
0d5660fbde
@ -18,25 +18,31 @@ endfunction()
|
|||||||
|
|
||||||
macro(project name)
|
macro(project name)
|
||||||
|
|
||||||
# Bridge existing documented variable names with library namespaced variables in order for old projects to work.
|
# Bridge existing documented variable names with library namespaced
|
||||||
|
# variables in order for old projects to work.
|
||||||
|
|
||||||
if(COMPONENT_DIRS)
|
if(COMPONENT_DIRS)
|
||||||
spaces2list(COMPONENT_DIRS)
|
spaces2list(COMPONENT_DIRS)
|
||||||
|
|
||||||
foreach(component_dir ${COMPONENT_DIRS})
|
foreach(component_dir ${COMPONENT_DIRS})
|
||||||
get_filename_component(full_path ${component_dir} ABSOLUTE)
|
get_filename_component(component_dir ${component_dir} ABSOLUTE BASE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
get_filename_component(idf_path "${IDF_PATH}/components" ABSOLUTE)
|
list(APPEND IDF_COMPONENT_DIRS "${component_dir}")
|
||||||
|
|
||||||
if(NOT full_path STREQUAL idf_path)
|
|
||||||
set(IDF_EXTRA_COMPONENT_DIRS "${IDF_EXTRA_COMPONENT_DIRS} ${component_dir}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
|
||||||
if(MAIN_SRCS)
|
|
||||||
set(IDF_EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} ${CMAKE_SOURCE_DIR}/components")
|
|
||||||
else()
|
|
||||||
set(IDF_EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} \
|
|
||||||
${CMAKE_SOURCE_DIR}/components ${CMAKE_SOURCE_DIR}/main")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(EXTRA_COMPONENT_DIRS)
|
||||||
|
spaces2list(EXTRA_COMPONENT_DIRS)
|
||||||
|
|
||||||
|
foreach(component_dir ${EXTRA_COMPONENT_DIRS})
|
||||||
|
get_filename_component(component_dir ${component_dir} ABSOLUTE BASE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
|
list(APPEND IDF_EXTRA_COMPONENT_DIRS "${component_dir}")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND IDF_EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/components")
|
||||||
|
|
||||||
|
if(NOT MAIN_SRCS)
|
||||||
|
list(APPEND IDF_EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/main")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(COMPONENTS)
|
if(COMPONENTS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user