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)
spaces2list(COMPONENT_DIRS)
foreach(component_dir ${COMPONENT_DIRS})
- get_filename_component(full_path ${component_dir} ABSOLUTE)
- get_filename_component(idf_path "${IDF_PATH}/components" ABSOLUTE)
+ get_filename_component(component_dir ${component_dir} ABSOLUTE BASE_DIR ${CMAKE_SOURCE_DIR})
+ list(APPEND IDF_COMPONENT_DIRS "${component_dir}")
+ endforeach()
+ endif()
- if(NOT full_path STREQUAL idf_path)
- set(IDF_EXTRA_COMPONENT_DIRS "${IDF_EXTRA_COMPONENT_DIRS} ${component_dir}")
- 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()
- 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()
+
+ 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()
if(COMPONENTS)