mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
cmake: add support for out-of-tree modules via EXTERNAL_MODULES_LOCATION variable
This commit is contained in:
@@ -146,6 +146,7 @@ set_property(CACHE CONFIG PROPERTY STRINGS ${configs})
|
||||
set(THREADS "4" CACHE STRING
|
||||
"number of threads to use for external build processes")
|
||||
set(DEBUG_PORT "/dev/ttyACM0" CACHE STRING "debugging port")
|
||||
set(EXTERNAL_MODULES_LOCATION "" CACHE STRING "External modules source location")
|
||||
|
||||
#=============================================================================
|
||||
# configuration
|
||||
@@ -371,6 +372,24 @@ foreach(driver ${config_df_driver_list})
|
||||
message("Adding DF driver: ${driver}")
|
||||
endforeach()
|
||||
|
||||
#=============================================================================
|
||||
# external modules
|
||||
#
|
||||
if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "")
|
||||
message(STATUS "External modules: ${EXTERNAL_MODULES_LOCATION}")
|
||||
add_subdirectory("${EXTERNAL_MODULES_LOCATION}/src" external_modules_src)
|
||||
|
||||
set(config_module_list_external_expanded)
|
||||
foreach(external_module ${config_module_list_external})
|
||||
list(APPEND config_module_list_external_expanded
|
||||
${EXTERNAL_MODULES_LOCATION}/src/${external_module})
|
||||
endforeach()
|
||||
set(config_module_list
|
||||
${config_module_list}
|
||||
${config_module_list_external_expanded}
|
||||
)
|
||||
endif()
|
||||
|
||||
#=============================================================================
|
||||
# subdirectories
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user