mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
cmake: add support for out-of-tree modules via EXTERNAL_MODULES_LOCATION variable
This commit is contained in:
@@ -231,6 +231,7 @@ endfunction()
|
||||
# [ COMPILE_FLAGS <list> ]
|
||||
# [ INCLUDES <list> ]
|
||||
# [ DEPENDS <string> ]
|
||||
# [ EXTERNAL ]
|
||||
# )
|
||||
#
|
||||
# Input:
|
||||
@@ -244,6 +245,7 @@ endfunction()
|
||||
# SRCS : source files
|
||||
# INCLUDES : include directories
|
||||
# DEPENDS : targets which this module depends on
|
||||
# EXTERNAL : flag to indicate that this module is out-of-tree
|
||||
#
|
||||
# Output:
|
||||
# Static library with name matching MODULE.
|
||||
@@ -263,9 +265,14 @@ function(px4_add_module)
|
||||
NAME px4_add_module
|
||||
ONE_VALUE MODULE MAIN STACK STACK_MAIN STACK_MAX PRIORITY
|
||||
MULTI_VALUE COMPILE_FLAGS LINK_FLAGS SRCS INCLUDES DEPENDS
|
||||
OPTIONS EXTERNAL
|
||||
REQUIRED MODULE
|
||||
ARGN ${ARGN})
|
||||
|
||||
if(EXTERNAL)
|
||||
px4_mangle_name("${EXTERNAL_MODULES_LOCATION}/src/${MODULE}" MODULE)
|
||||
endif()
|
||||
|
||||
px4_add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${SRCS})
|
||||
|
||||
# set defaults if not set
|
||||
|
||||
Reference in New Issue
Block a user