mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
cmake only include mavlink where used
This commit is contained in:
committed by
Lorenz Meier
parent
5984e3d330
commit
6a443765a5
@@ -458,7 +458,6 @@ function(px4_add_common_flags)
|
|||||||
${PX4_BINARY_DIR}
|
${PX4_BINARY_DIR}
|
||||||
${PX4_BINARY_DIR}/src
|
${PX4_BINARY_DIR}/src
|
||||||
${PX4_BINARY_DIR}/src/modules
|
${PX4_BINARY_DIR}/src/modules
|
||||||
${PX4_SOURCE_DIR}/mavlink/include/mavlink
|
|
||||||
${PX4_SOURCE_DIR}/src
|
${PX4_SOURCE_DIR}/src
|
||||||
${PX4_SOURCE_DIR}/src/drivers/boards/${BOARD}
|
${PX4_SOURCE_DIR}/src/drivers/boards/${BOARD}
|
||||||
${PX4_SOURCE_DIR}/src/include
|
${PX4_SOURCE_DIR}/src/include
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ function(px4_posix_generate_builtin_commands)
|
|||||||
MULTI_VALUE MODULE_LIST
|
MULTI_VALUE MODULE_LIST
|
||||||
REQUIRED MODULE_LIST OUT
|
REQUIRED MODULE_LIST OUT
|
||||||
ARGN ${ARGN})
|
ARGN ${ARGN})
|
||||||
|
|
||||||
set(builtin_apps_string)
|
set(builtin_apps_string)
|
||||||
set(builtin_apps_decl_string)
|
set(builtin_apps_decl_string)
|
||||||
set(command_count 0)
|
set(command_count 0)
|
||||||
@@ -101,10 +102,8 @@ function(px4_posix_generate_builtin_commands)
|
|||||||
math(EXPR command_count "${command_count}+1")
|
math(EXPR command_count "${command_count}+1")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
configure_file(${PX4_SOURCE_DIR}/src/platforms/apps.cpp.in
|
configure_file(${PX4_SOURCE_DIR}/src/platforms/apps.cpp.in ${OUT}.cpp)
|
||||||
${OUT}.cpp)
|
configure_file(${PX4_SOURCE_DIR}/src/platforms/apps.h.in ${OUT}.h)
|
||||||
configure_file(${PX4_SOURCE_DIR}/src/platforms/apps.h.in
|
|
||||||
${OUT}.h)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
@@ -168,15 +167,12 @@ function(px4_os_add_flags)
|
|||||||
LINK_DIRS ${LINK_DIRS}
|
LINK_DIRS ${LINK_DIRS}
|
||||||
DEFINITIONS ${DEFINITIONS})
|
DEFINITIONS ${DEFINITIONS})
|
||||||
|
|
||||||
set(PX4_BASE )
|
|
||||||
set(added_include_dirs
|
set(added_include_dirs
|
||||||
src/modules/systemlib
|
|
||||||
src/platforms/posix/include
|
src/platforms/posix/include
|
||||||
mavlink/include/mavlink
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# This block sets added_definitions and added_cxx_flags.
|
# This block sets added_definitions and added_cxx_flags.
|
||||||
if(UNIX AND APPLE)
|
if(UNIX AND APPLE)
|
||||||
set(added_definitions
|
set(added_definitions
|
||||||
-D__PX4_POSIX
|
-D__PX4_POSIX
|
||||||
-D__PX4_DARWIN
|
-D__PX4_DARWIN
|
||||||
@@ -201,7 +197,7 @@ if(UNIX AND APPLE)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
set(added_definitions
|
set(added_definitions
|
||||||
-D__PX4_POSIX
|
-D__PX4_POSIX
|
||||||
@@ -215,12 +211,12 @@ else()
|
|||||||
-pthread
|
-pthread
|
||||||
)
|
)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(added_exe_linker_flags)
|
set(added_exe_linker_flags)
|
||||||
|
|
||||||
# This block sets added_c_flags (appends to others).
|
# This block sets added_c_flags (appends to others).
|
||||||
if ("${BOARD}" STREQUAL "eagle")
|
if ("${BOARD}" STREQUAL "eagle")
|
||||||
|
|
||||||
if ("$ENV{HEXAGON_ARM_SYSROOT}" STREQUAL "")
|
if ("$ENV{HEXAGON_ARM_SYSROOT}" STREQUAL "")
|
||||||
message(FATAL_ERROR "HEXAGON_ARM_SYSROOT not set")
|
message(FATAL_ERROR "HEXAGON_ARM_SYSROOT not set")
|
||||||
@@ -241,8 +237,8 @@ if ("${BOARD}" STREQUAL "eagle")
|
|||||||
-Wl,-rpath-link,${HEXAGON_ARM_SYSROOT}/lib
|
-Wl,-rpath-link,${HEXAGON_ARM_SYSROOT}/lib
|
||||||
--sysroot=${HEXAGON_ARM_SYSROOT}
|
--sysroot=${HEXAGON_ARM_SYSROOT}
|
||||||
)
|
)
|
||||||
# This block sets added_c_flags (appends to others).
|
# This block sets added_c_flags (appends to others).
|
||||||
elseif ("${BOARD}" STREQUAL "excelsior")
|
elseif ("${BOARD}" STREQUAL "excelsior")
|
||||||
|
|
||||||
if ("$ENV{HEXAGON_ARM_SYSROOT}" STREQUAL "")
|
if ("$ENV{HEXAGON_ARM_SYSROOT}" STREQUAL "")
|
||||||
message(FATAL_ERROR "HEXAGON_ARM_SYSROOT not set")
|
message(FATAL_ERROR "HEXAGON_ARM_SYSROOT not set")
|
||||||
@@ -267,7 +263,7 @@ elseif ("${BOARD}" STREQUAL "excelsior")
|
|||||||
--sysroot=${HEXAGON_ARM_SYSROOT}/lib32-apq8096 -mfloat-abi=softfp -mfpu=neon -mthumb-interwork
|
--sysroot=${HEXAGON_ARM_SYSROOT}/lib32-apq8096 -mfloat-abi=softfp -mfpu=neon -mthumb-interwork
|
||||||
|
|
||||||
)
|
)
|
||||||
elseif ("${BOARD}" STREQUAL "rpi")
|
elseif ("${BOARD}" STREQUAL "rpi")
|
||||||
SET(RPI_COMPILE_FLAGS
|
SET(RPI_COMPILE_FLAGS
|
||||||
-mcpu=cortex-a53
|
-mcpu=cortex-a53
|
||||||
-mfpu=neon
|
-mfpu=neon
|
||||||
@@ -296,8 +292,7 @@ elseif ("${BOARD}" STREQUAL "rpi")
|
|||||||
-L${CXX_COMPILER_PATH}/arm-linux-gnueabihf/libc/usr/lib
|
-L${CXX_COMPILER_PATH}/arm-linux-gnueabihf/libc/usr/lib
|
||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
else()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
# output
|
# output
|
||||||
foreach(var ${inout_vars})
|
foreach(var ${inout_vars})
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE drivers__pwm_out_rc_in
|
MODULE drivers__pwm_out_rc_in
|
||||||
MAIN pwm_out_rc_in
|
MAIN pwm_out_rc_in
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE drivers__snapdragon_rc_pwm
|
MODULE drivers__snapdragon_rc_pwm
|
||||||
MAIN snapdragon_rc_pwm
|
MAIN snapdragon_rc_pwm
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__mavlink
|
MODULE modules__mavlink
|
||||||
MAIN mavlink
|
MAIN mavlink
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__mavlink__mavlink_tests
|
MODULE modules__mavlink__mavlink_tests
|
||||||
MAIN mavlink_tests
|
MAIN mavlink_tests
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
option(ENABLE_UART_RC_INPUT "Enable RC Input from UART mavlink connection" OFF)
|
option(ENABLE_UART_RC_INPUT "Enable RC Input from UART mavlink connection" OFF)
|
||||||
|
|
||||||
if(ENABLE_UART_RC_INPUT)
|
if(ENABLE_UART_RC_INPUT)
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ add_definitions(
|
|||||||
add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
|
add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
|
||||||
add_dependencies(uavcan platforms__nuttx)
|
add_dependencies(uavcan platforms__nuttx)
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
include_directories(libuavcan/libuavcan/include)
|
include_directories(libuavcan/libuavcan/include)
|
||||||
include_directories(libuavcan/libuavcan/include/dsdlc_generated)
|
include_directories(libuavcan/libuavcan/include/dsdlc_generated)
|
||||||
include_directories(libuavcan/libuavcan_drivers/posix/include)
|
include_directories(libuavcan/libuavcan_drivers/posix/include)
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE platforms__posix__drivers__accelsim
|
MODULE platforms__posix__drivers__accelsim
|
||||||
MAIN accelsim
|
MAIN accelsim
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE platforms__posix__drivers__airspeedsim
|
MODULE platforms__posix__drivers__airspeedsim
|
||||||
MAIN measairspeedsim
|
MAIN measairspeedsim
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE platforms__posix__drivers__barosim
|
MODULE platforms__posix__drivers__barosim
|
||||||
MAIN barosim
|
MAIN barosim
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE platforms__posix__drivers__gpssim
|
MODULE platforms__posix__drivers__gpssim
|
||||||
MAIN gpssim
|
MAIN gpssim
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
|
include_directories(${PX4_SOURCE_DIR}/mavlink/include/mavlink)
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE platforms__posix__drivers__gyrosim
|
MODULE platforms__posix__drivers__gyrosim
|
||||||
MAIN gyrosim
|
MAIN gyrosim
|
||||||
|
|||||||
Reference in New Issue
Block a user