cmake move custom upload helpers to boards/

This commit is contained in:
Daniel Agar 2018-12-04 11:13:56 -05:00
parent e69049ec41
commit dbee6380ee
11 changed files with 229 additions and 160 deletions

View File

@ -0,0 +1,65 @@
############################################################################
#
# Copyright (c) 2018 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
add_subdirectory(bbblue_adc)
############################################################################
# Upload
############################################################################
if("${PX4_PLATFORM}" MATCHES "qurt")
add_custom_target(upload
COMMAND
${PX4_SOURCE_DIR}/Tools/adb_upload.sh
${CMAKE_CURRENT_BINARY_DIR}/libpx4.so ${CMAKE_CURRENT_BINARY_DIR}/libpx4muorb_skel.so ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config # source
/usr/share/data/adsp # destination
DEPENDS px4 px4muorb_skel
COMMENT "uploading px4"
USES_TERMINAL
)
else()
add_custom_target(upload
COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/scripts/adb_upload.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config # source
/home/linaro # destination
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)
endif()

View File

@ -32,3 +32,15 @@
############################################################################ ############################################################################
add_subdirectory(bbblue_adc) add_subdirectory(bbblue_adc)
############################################################################
# Upload
############################################################################
add_custom_target(upload
COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_SOURCE_DIR}/ROMFS debian@BBBluePX4:/home/debian/px4
DEPENDS px4
COMMENT "uploading px4 and data files"
USES_TERMINAL
)

View File

@ -34,3 +34,15 @@
add_subdirectory(navio_adc) add_subdirectory(navio_adc)
add_subdirectory(navio_rgbled) add_subdirectory(navio_rgbled)
add_subdirectory(navio_sysfs_rc_in) add_subdirectory(navio_sysfs_rc_in)
############################################################################
# Upload
############################################################################
add_custom_target(upload
COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS pi@"$ENV{AUTOPILOT_HOST}":/home/pi
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)

View File

@ -32,3 +32,16 @@
############################################################################ ############################################################################
add_subdirectory(aerofc_adc) add_subdirectory(aerofc_adc)
############################################################################
# Upload
############################################################################
add_custom_target(upload
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/aero_upload.sh $<TARGET_FILE:px4>
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)

View File

@ -32,3 +32,15 @@
############################################################################ ############################################################################
add_subdirectory(flow) add_subdirectory(flow)
############################################################################
# Upload
############################################################################
add_custom_target(upload
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/adb_upload_to_bebop.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/. /data/ftp/internal_000
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)

View File

@ -35,10 +35,10 @@ include(cygwin_cygpath)
add_subdirectory(src) add_subdirectory(src)
add_executable(px4 ${PX4_SOURCE_DIR}/src/platforms/empty.c)
set(FW_NAME ${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf) set(FW_NAME ${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf)
set_target_properties(px4 PROPERTIES OUTPUT_NAME ${FW_NAME})
add_executable(${FW_NAME} ${PX4_SOURCE_DIR}/src/platforms/empty.c) add_dependencies(px4 git_nuttx nuttx_build)
add_dependencies(${FW_NAME} git_nuttx nuttx_build)
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES) get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
@ -81,7 +81,7 @@ target_link_libraries(nuttx_arch
target_link_libraries(nuttx_c INTERFACE nuttx_drivers) target_link_libraries(nuttx_c INTERFACE nuttx_drivers)
target_link_libraries(nuttx_cxx INTERFACE nuttx_c) target_link_libraries(nuttx_cxx INTERFACE nuttx_c)
target_link_libraries(${FW_NAME} PRIVATE target_link_libraries(px4 PRIVATE
-nodefaultlibs -nodefaultlibs
-nostdlib -nostdlib
@ -101,55 +101,43 @@ target_link_libraries(${FW_NAME} PRIVATE
m m
) )
target_link_libraries(${FW_NAME} PRIVATE ${module_libraries}) target_link_libraries(px4 PRIVATE ${module_libraries})
target_link_libraries(${FW_NAME} PRIVATE modules__uORB) target_link_libraries(px4 PRIVATE modules__uORB)
if (config_romfs_root) if (config_romfs_root)
add_subdirectory(${PX4_SOURCE_DIR}/ROMFS ${PX4_BINARY_DIR}/ROMFS) add_subdirectory(${PX4_SOURCE_DIR}/ROMFS ${PX4_BINARY_DIR}/ROMFS)
target_link_libraries(${FW_NAME} PRIVATE romfs) target_link_libraries(px4 PRIVATE romfs)
endif() endif()
# create px4 file (combined firmware and metadata)
# for historical reasons we name the final output binary without nuttx_
set(fw_name_short)
string(REPLACE "nuttx_" "" fw_name_short ${FW_NAME})
set(fw_file ${PX4_BINARY_DIR}/${fw_name_short})
string(REPLACE ".elf" ".px4" fw_file ${fw_file})
add_custom_command(OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin add_custom_command(OUTPUT ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin
COMMAND ${CMAKE_OBJCOPY} -O binary ${PX4_BINARY_DIR_REL}/${FW_NAME} ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin COMMAND ${CMAKE_OBJCOPY} -O binary ${PX4_BINARY_DIR_REL}/${FW_NAME} ${PX4_BINARY_DIR_REL}/${PX4_BOARD}.bin
DEPENDS ${FW_NAME} DEPENDS px4
) )
set(FW_PROTOTYPE ${PX4_BOARD_VENDOR}${PX4_BOARD_MODEL}) # create .px4 with parameter and airframe metadata
if (TARGET parameters_xml AND TARGET airframes_xml) if (TARGET parameters_xml AND TARGET airframes_xml)
add_custom_command(OUTPUT ${fw_file}
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py string(REPLACE ".elf" ".px4" fw_package ${FW_NAME})
add_custom_command(OUTPUT ${fw_package}
COMMAND
${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_mkfw.py
--prototype ${PX4_SOURCE_DIR}/boards/${PX4_BOARD_VENDOR}/${PX4_BOARD_MODEL}/firmware.prototype --prototype ${PX4_SOURCE_DIR}/boards/${PX4_BOARD_VENDOR}/${PX4_BOARD_MODEL}/firmware.prototype
--git_identity ${PX4_SOURCE_DIR} --git_identity ${PX4_SOURCE_DIR}
--parameter_xml ${PX4_BINARY_DIR}/parameters.xml --parameter_xml ${PX4_BINARY_DIR}/parameters.xml
--airframe_xml ${PX4_BINARY_DIR}/airframes.xml --airframe_xml ${PX4_BINARY_DIR}/airframes.xml
--image ${PX4_BINARY_DIR}/${PX4_BOARD}.bin > ${fw_file} --image ${PX4_BINARY_DIR}/${PX4_BOARD}.bin > ${fw_package}
DEPENDS ${PX4_BINARY_DIR}/${PX4_BOARD}.bin parameters_xml airframes_xml DEPENDS
COMMENT "Creating ${fw_file}" ${PX4_BINARY_DIR}/${PX4_BOARD}.bin
airframes_xml
parameters_xml
COMMENT "Creating ${fw_package}"
WORKING_DIRECTORY ${PX4_BINARY_DIR}
) )
add_custom_target(px4 ALL DEPENDS ${fw_file}) add_custom_target(px4_package ALL DEPENDS ${fw_package})
# upload helper # upload helper
if (${PX4_BOARD} STREQUAL "aerofc-v1")
# TODO: should be set only in aero config
add_custom_target(upload
COMMAND ${PX4_SOURCE_DIR}/Tools/aero_upload.sh ${fw_file}
DEPENDS ${fw_file}
COMMENT "uploading px4"
USES_TERMINAL
)
else()
# create upload target helper if NuttX USB CDCACM is present # create upload target helper if NuttX USB CDCACM is present
if (CONFIG_CDCACM) if (CONFIG_CDCACM)
@ -198,43 +186,44 @@ if (TARGET parameters_xml AND TARGET airframes_xml)
string(REPLACE ";" "," serial_ports "${serial_ports}") string(REPLACE ";" "," serial_ports "${serial_ports}")
add_custom_target(upload add_custom_target(upload
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${fw_file} COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${fw_package}
DEPENDS ${fw_file} DEPENDS ${fw_package}
COMMENT "uploading px4" COMMENT "uploading px4"
VERBATIM VERBATIM
USES_TERMINAL USES_TERMINAL
WORKING_DIRECTORY ${PX4_BINARY_DIR}
) )
add_custom_target(force-upload add_custom_target(force-upload
COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --force --port ${serial_ports} ${fw_file} COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_uploader.py --force --port ${serial_ports} ${fw_package}
DEPENDS ${fw_file} DEPENDS ${fw_package}
COMMENT "uploading px4 with --force" COMMENT "uploading px4 with --force"
VERBATIM VERBATIM
USES_TERMINAL USES_TERMINAL
WORKING_DIRECTORY ${PX4_BINARY_DIR}
) )
endif() endif()
endif() endif()
endif()
# print size # print size
add_custom_target(size add_custom_target(size
COMMAND size ${FW_NAME} COMMAND size $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} DEPENDS px4
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
USES_TERMINAL USES_TERMINAL
) )
# print weak symbols # print weak symbols
add_custom_target(weak_symbols add_custom_target(weak_symbols
COMMAND ${CMAKE_NM} $<TARGET_FILE:${FW_NAME}> | ${GREP} " w " | cat COMMAND ${CMAKE_NM} $<TARGET_FILE:px4> | ${GREP} " w " | cat
DEPENDS ${FW_NAME} DEPENDS px4
VERBATIM VERBATIM
USES_TERMINAL USES_TERMINAL
) )
add_custom_target(stack_check add_custom_target(stack_check
COMMAND ${CMAKE_COMMAND} -E make_directory stack_usage && ${CMAKE_OBJDUMP} -d $<TARGET_FILE:${FW_NAME}> | ${PX4_SOURCE_DIR}/Tools/stack_usage/checkstack.pl arm 0 > stack_usage/checkstack_output.txt 2> stack_usage/checkstack_errors.txt COMMAND ${CMAKE_COMMAND} -E make_directory stack_usage && ${CMAKE_OBJDUMP} -d $<TARGET_FILE:px4> | ${PX4_SOURCE_DIR}/Tools/stack_usage/checkstack.pl arm 0 > stack_usage/checkstack_output.txt 2> stack_usage/checkstack_errors.txt
COMMAND ${CMAKE_COMMAND} -E echo "" COMMAND ${CMAKE_COMMAND} -E echo ""
COMMAND ${CMAKE_COMMAND} -E echo "" COMMAND ${CMAKE_COMMAND} -E echo ""
COMMAND ${CMAKE_COMMAND} -E echo "Top 50:" COMMAND ${CMAKE_COMMAND} -E echo "Top 50:"
@ -244,7 +233,7 @@ add_custom_target(stack_check
COMMAND ${CMAKE_COMMAND} -E echo "Symbols with 'run', 'task', 'thread', 'main', 'update':" COMMAND ${CMAKE_COMMAND} -E echo "Symbols with 'run', 'task', 'thread', 'main', 'update':"
COMMAND ${CMAKE_COMMAND} -E echo "--------------------------------------------------------------------------------" COMMAND ${CMAKE_COMMAND} -E echo "--------------------------------------------------------------------------------"
COMMAND cat stack_usage/checkstack_output.txt | c++filt | grep -E 'run|task|thread|main|update' COMMAND cat stack_usage/checkstack_output.txt | c++filt | grep -E 'run|task|thread|main|update'
DEPENDS ${FW_NAME} DEPENDS px4
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
VERBATIM VERBATIM
) )
@ -253,29 +242,29 @@ find_program(BLOATY_PROGRAM bloaty)
if (BLOATY_PROGRAM) if (BLOATY_PROGRAM)
# bloaty symbols # bloaty symbols
add_custom_target(bloaty_symbols add_custom_target(bloaty_symbols
COMMAND ${BLOATY_PROGRAM} -d symbols -C full -n 50 -s vm $<TARGET_FILE:${FW_NAME}> COMMAND ${BLOATY_PROGRAM} -d symbols -C full -n 50 -s vm $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} DEPENDS px4
USES_TERMINAL USES_TERMINAL
) )
# bloaty compilation units # bloaty compilation units
add_custom_target(bloaty_compileunits add_custom_target(bloaty_compileunits
COMMAND ${BLOATY_PROGRAM} -d compileunits -C full -n 50 -s vm $<TARGET_FILE:${FW_NAME}> COMMAND ${BLOATY_PROGRAM} -d compileunits -C full -n 50 -s vm $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} DEPENDS px4
USES_TERMINAL USES_TERMINAL
) )
# bloaty templates # bloaty templates
add_custom_target(bloaty_templates add_custom_target(bloaty_templates
COMMAND ${BLOATY_PROGRAM} -d shortsymbols,fullsymbols -n 50 $<TARGET_FILE:${FW_NAME}> COMMAND ${BLOATY_PROGRAM} -d shortsymbols,fullsymbols -n 50 $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} DEPENDS px4
USES_TERMINAL USES_TERMINAL
) )
# bloaty inlines # bloaty inlines
add_custom_target(bloaty_inlines add_custom_target(bloaty_inlines
COMMAND ${BLOATY_PROGRAM} -d inlines -C full -n 50 $<TARGET_FILE:${FW_NAME}> COMMAND ${BLOATY_PROGRAM} -d inlines -C full -n 50 $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} DEPENDS px4
USES_TERMINAL USES_TERMINAL
) )
@ -283,8 +272,8 @@ if (BLOATY_PROGRAM)
add_custom_target(bloaty_compare_master add_custom_target(bloaty_compare_master
#COMMAND wget --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${FW_NAME} -O master_${FW_NAME} #COMMAND wget --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${FW_NAME} -O master_${FW_NAME}
COMMAND wget --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf -O master_${FW_NAME} COMMAND wget --no-verbose https://s3.amazonaws.com/px4-travis/Firmware/master/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.elf -O master_${FW_NAME}
COMMAND ${BLOATY_PROGRAM} -d symbols -n 50 -C full -s vm $<TARGET_FILE:${FW_NAME}> -- master_${FW_NAME} COMMAND ${BLOATY_PROGRAM} -d symbols -n 50 -C full -s vm $<TARGET_FILE:px4> -- master_${FW_NAME}
DEPENDS ${FW_NAME} DEPENDS px4
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
VERBATIM VERBATIM
USES_TERMINAL USES_TERMINAL
@ -296,8 +285,8 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/gdbinit.in ${PX4_BINARY_DIR}/.gdbinit) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/gdbinit.in ${PX4_BINARY_DIR}/.gdbinit)
add_custom_target(debug add_custom_target(debug
COMMAND ${GDB} -iex 'set auto-load safe-path ${PX4_BINARY_DIR}' $<TARGET_FILE:${FW_NAME}> COMMAND ${GDB} -iex 'set auto-load safe-path ${PX4_BINARY_DIR}' $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
USES_TERMINAL USES_TERMINAL
) )
@ -323,8 +312,8 @@ if(black_magic_probe_path)
-ex 'attach 1' -ex 'attach 1'
-ex 'load' -ex 'load'
-ex 'run' -ex 'run'
$<TARGET_FILE:${FW_NAME}> $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
USES_TERMINAL USES_TERMINAL
) )
@ -338,8 +327,8 @@ if(black_magic_probe_path)
-ex 'attach 1' -ex 'attach 1'
-ex 'load' -ex 'load'
-ex 'kill' -ex 'kill'
$<TARGET_FILE:${FW_NAME}> $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} DEPENDS px4
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
USES_TERMINAL USES_TERMINAL
COMMENT "Uploading with Black Magic Probe" COMMENT "Uploading with Black Magic Probe"
@ -360,8 +349,8 @@ add_custom_target(jlink_upload
-ex 'monitor reset' -ex 'monitor reset'
-ex 'load' -ex 'load'
-ex 'kill' -ex 'kill'
$<TARGET_FILE:${FW_NAME}> $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
USES_TERMINAL USES_TERMINAL
) )
@ -375,8 +364,8 @@ add_custom_target(jlink_debug
-ex 'load' -ex 'load'
-ex 'monitor reset' -ex 'monitor reset'
-ex 'continue' -ex 'continue'
$<TARGET_FILE:${FW_NAME}> $<TARGET_FILE:px4>
DEPENDS ${FW_NAME} ${PX4_BINARY_DIR}/.gdbinit DEPENDS px4 ${PX4_BINARY_DIR}/.gdbinit
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
USES_TERMINAL USES_TERMINAL
) )
@ -395,8 +384,8 @@ ExternalProject_Add(FlameGraph
add_custom_target(profile add_custom_target(profile
COMMAND ${CMAKE_COMMAND} -E env PATH="${PX4_BINARY_DIR}/external/Source/FlameGraph:$ENV{PATH}" COMMAND ${CMAKE_COMMAND} -E env PATH="${PX4_BINARY_DIR}/external/Source/FlameGraph:$ENV{PATH}"
${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh --elf=$<TARGET_FILE:${FW_NAME}> --nsamples=10000 ${CMAKE_CURRENT_SOURCE_DIR}/Debug/poor-mans-profiler.sh --elf=$<TARGET_FILE:px4> --nsamples=10000
DEPENDS ${FW_NAME} ${PX4_SOURCE_DIR}/platforms/nuttx/Debug/poor-mans-profiler.sh FlameGraph DEPENDS px4 ${CMAKE_CURRENT_SOURCE_DIR}/Debug/poor-mans-profiler.sh FlameGraph
USES_TERMINAL USES_TERMINAL
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR}
) )

View File

@ -46,13 +46,6 @@ if (("${PX4_BOARD}" MATCHES "atlflight_eagle") OR ("${PX4_BOARD}" MATCHES "atlfl
-Wl,--end-group -Wl,--end-group
) )
add_custom_target(upload
COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config /home/linaro
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)
else() else()
add_executable(px4 add_executable(px4
src/main.cpp src/main.cpp
@ -100,33 +93,16 @@ px4_posix_generate_symlinks(
TARGET px4 TARGET px4
) )
if (("${PX4_BOARD}" MATCHES "raspberrypi") OR ("${PX4_BOARD}" MATCHES "navio2"))
add_custom_target(upload
COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config ${PX4_SOURCE_DIR}/ROMFS pi@"$ENV{AUTOPILOT_HOST}":/home/pi
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)
elseif ("${PX4_BOARD}" MATCHES "beaglebone_blue") # board defined upload helper
if(EXISTS "${PX4_BOARD_DIR}/cmake/upload.cmake")
include(${PX4_BOARD_DIR}/cmake/upload.cmake)
endif()
if ("${PX4_BOARD}" MATCHES "beaglebone_blue")
target_link_libraries(px4 PRIVATE robotcontrol) target_link_libraries(px4 PRIVATE robotcontrol)
add_custom_target(upload
COMMAND rsync -arh --progress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${PX4_SOURCE_DIR}/posix-configs/bbblue/*.config ${PX4_SOURCE_DIR}/ROMFS debian@BBBluePX4:/home/debian/px4
DEPENDS px4
COMMENT "uploading px4 and data files"
USES_TERMINAL
)
elseif ("${PX4_BOARD}" MATCHES "bebop")
add_custom_target(upload
COMMAND ${PX4_SOURCE_DIR}/Tools/adb_upload_to_bebop.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/. /data/ftp/internal_000
DEPENDS px4
COMMENT "uploading px4"
USES_TERMINAL
)
elseif ("${PX4_BOARD}" MATCHES "sitl") elseif ("${PX4_BOARD}" MATCHES "sitl")
include(sitl_target) include(sitl_target)

View File

@ -51,14 +51,4 @@ else()
m m
) )
add_custom_target(upload
COMMAND
${PX4_SOURCE_DIR}/Tools/adb_upload.sh
${CMAKE_CURRENT_BINARY_DIR}/libpx4.so ${CMAKE_CURRENT_BINARY_DIR}/libpx4muorb_skel.so ${PX4_SOURCE_DIR}/posix-configs/eagle/flight/px4.config
/usr/share/data/adsp
DEPENDS px4 px4muorb_skel
COMMENT "uploading px4"
USES_TERMINAL
)
endif() endif()