feat: Organize CMakeLists for modular source management across main components
This commit is contained in:
19
main/ui/apps/CMakeLists.txt
Normal file
19
main/ui/apps/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
# Control which apps are included in the build.
|
||||
# Override `ENABLED_APPS` from the top-level CMake command line to change apps.
|
||||
if(NOT DEFINED ENABLED_APPS)
|
||||
set(ENABLED_APPS "iotdis")
|
||||
endif()
|
||||
message(STATUS "Enabled apps: ${ENABLED_APPS}")
|
||||
|
||||
foreach(app IN LISTS ENABLED_APPS)
|
||||
set(APP_DIR "${CMAKE_CURRENT_LIST_DIR}/${app}")
|
||||
if(EXISTS "${APP_DIR}/CMakeLists.txt")
|
||||
include("${APP_DIR}/CMakeLists.txt")
|
||||
else()
|
||||
message(WARNING "App '${app}' has no CMakeLists.txt — attempting to add any sources directly")
|
||||
file(GLOB APP_SRCS "${APP_DIR}/*.c" "${APP_DIR}/*.cpp" "${APP_DIR}/*/*.c" "${APP_DIR}/*/*.cpp")
|
||||
if(APP_SRCS)
|
||||
list(APPEND SRCS ${APP_SRCS})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
Reference in New Issue
Block a user