Code: Select all
list(APPEND COMPONENTS_PROJECT_A
comp1
comp2
comp3
)
list(APPEND COMPONENTS_PROJECT_B
comp2
comp3
comp4
)
list(APPEND COMPONENTS_PROJECT_C
comp1
comp3
comp5
)
Code: Select all
..... SDKCONFIG PARSING ....
if(PROJECT_TYPE STREQUAL "PROJECT_A")
set(REQUIRED_COMPONENTS ${COMPONENTS_PROJECT_A})
elseif(PROJECT_TYPE STREQUAL "PROJECT_B")
set(REQUIRED_COMPONENTS ${COMPONENTS_PROJECT_B})
elseif(PROJECT_TYPE STREQUAL "PROJECT_C")
set(REQUIRED_COMPONENTS ${COMPONENTS_PROJECT_C})
else()
message(FATAL_ERROR)
endif()
#Only build required components rather than everything in components directories.
set(COMPONENTS ${REQUIRED_COMPONENTS})
Code: Select all
-- Calling project(XXXXXXX)
-- ccache will be used for faster recompilation
-- Building ESP-IDF components for target esp32
-- Component-level PROJECT_TYPE:
.......
.......
.......
-- Component-level PROJECT_TYPE: PROJECT_A
How can I fix this problem? Is there any easier way to handle this?
Thanks in advance!