Revert "Implement the way to run posix simulator directly from IDE without the need to reconfigure command lines, but use runner created via CMake"

This reverts commit fff4934743.
This commit is contained in:
Lorenz Meier
2016-12-12 22:32:34 +01:00
parent 4cb9903561
commit 1926c7bca7
4 changed files with 101 additions and 198 deletions
+101 -130
View File
@@ -4,137 +4,122 @@ px4_posix_generate_builtin_commands(
OUT apps
MODULE_LIST ${module_libraries})
if ("${BOARD}" STREQUAL "eagle" OR ("${BOARD}" STREQUAL "excelsior"))
function(px4_add_sitl_app)
px4_parse_function_args(
NAME px4_add_sitl_app
ONE_VALUE APP_NAME MAIN_SRC UPLOAD_NAME
REQUIRED APP_NAME MAIN_SRC
ARGN ${ARGN})
include(fastrpc)
include(linux_app)
if ("${BOARD}" STREQUAL "eagle" OR ("${BOARD}" STREQUAL "excelsior"))
FASTRPC_STUB_GEN(../qurt/px4muorb.idl)
include(fastrpc)
include(linux_app)
FASTRPC_STUB_GEN(../qurt/px4muorb.idl)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-prototypes -Wno-missing-declarations")
LINUX_APP(
APP_NAME ${APP_NAME}
IDL_NAME px4muorb
APPS_DEST "/home/linaro"
SOURCES
px4muorb_stub.c
${MAIN_SRC}
apps.cpp
LINK_LIBS
-Wl,--start-group
${module_libraries}
${df_driver_libs}
${FASTRPC_ARM_LIBS}
pthread m rt
-Wl,--end-group
)
px4_add_adb_push(OUT ${UPLOAD_NAME}
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/${APP_NAME}
${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config
DEPENDS ${APP_NAME}
DEST /home/linaro)
elseif ("${BOARD}" STREQUAL "rpi")
px4_add_executable(${APP_NAME}
${MAIN_SRC}
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-prototypes -Wno-missing-declarations")
LINUX_APP(
APP_NAME px4
IDL_NAME px4muorb
APPS_DEST "/home/linaro"
SOURCES
px4muorb_stub.c
${PX4_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.cpp
)
target_link_libraries(${APP_NAME}
LINK_LIBS
-Wl,--start-group
${module_libraries}
${df_driver_libs}
${FASTRPC_ARM_LIBS}
pthread m rt
-Wl,--end-group
)
px4_add_adb_push(OUT upload
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/px4
${PX4_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config
DEPENDS px4
DEST /home/linaro)
elseif ("${BOARD}" STREQUAL "rpi")
px4_add_executable(px4
${PX4_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.cpp
)
target_link_libraries(px4
-Wl,--start-group
${module_libraries}
df_driver_framework
${df_driver_libs}
pthread m rt
-Wl,--end-group
)
file(GLOB RPI_CONFIG_FILES ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config)
px4_add_scp_push(OUT upload
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/px4
${RPI_CONFIG_FILES}
${PX4_SOURCE_DIR}/ROMFS
DEPENDS px4
DEST /home/pi)
elseif ("${BOARD}" STREQUAL "bebop")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
px4_add_executable(px4
${PX4_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.cpp
)
if (NOT APPLE)
target_link_libraries(px4
-Wl,--start-group
${module_libraries}
df_driver_framework
${df_driver_libs}
pthread m rt
-Wl,--end-group
)
file(GLOB RPI_CONFIG_FILES ${PX4_SOURCE_DIR}/posix-configs/rpi/*.config)
px4_add_scp_push(OUT ${UPLOAD_NAME}
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/${APP_NAME}
${RPI_CONFIG_FILES}
${PX4_SOURCE_DIR}/ROMFS
DEPENDS ${APP_NAME}
DEST /home/pi)
elseif ("${BOARD}" STREQUAL "bebop")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
px4_add_executable(${APP_NAME}
${MAIN_SRC}
apps.cpp
)
if (NOT APPLE)
target_link_libraries(${APP_NAME}
-Wl,--start-group
${module_libraries}
${df_driver_libs}
pthread m rt
-Wl,--end-group
)
else()
target_link_libraries(${APP_NAME}
${module_libraries}
${df_driver_libs}
pthread m
)
endif()
px4_add_adb_push_to_bebop(OUT ${UPLOAD_NAME}
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/${APP_NAME}
DEPENDS ${APP_NAME}
DEST /usr/bin)
else()
px4_add_executable(${APP_NAME}
${MAIN_SRC}
apps.cpp
target_link_libraries(px4
${module_libraries}
${df_driver_libs}
pthread m
)
if (NOT APPLE)
target_link_libraries(${APP_NAME}
-Wl,--start-group
${module_libraries}
${df_driver_libs}
pthread m rt
-Wl,--end-group
)
else()
target_link_libraries(${APP_NAME}
${module_libraries}
${df_driver_libs}
pthread m
)
endif()
endif()
endfunction()
SET(SITL_RUNNER_MAIN_CPP ${PX4_SOURCE_DIR}/src/platforms/posix/main.cpp)
px4_add_sitl_app(APP_NAME px4
UPLOAD_NAME upload
MAIN_SRC ${SITL_RUNNER_MAIN_CPP}
px4_add_adb_push_to_bebop(OUT upload
OS ${OS}
BOARD ${BOARD}
FILES ${CMAKE_CURRENT_BINARY_DIR}/px4
DEPENDS px4
DEST /usr/bin)
else()
px4_add_executable(px4
${PX4_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.cpp
)
if (NOT APPLE)
target_link_libraries(px4
-Wl,--start-group
${module_libraries}
${df_driver_libs}
pthread m rt
-Wl,--end-group
)
else()
target_link_libraries(px4
${module_libraries}
${df_driver_libs}
pthread m
)
endif()
endif()
#=============================================================================
# sitl run targets
#
@@ -167,7 +152,7 @@ set_target_properties(sitl_gazebo PROPERTIES EXCLUDE_FROM_ALL TRUE)
# create targets for each viewer/model/debugger combination
set(viewers none jmavsim gazebo replay)
set(debuggers none ide gdb lldb ddd valgrind)
set(debuggers none gdb lldb ddd valgrind)
set(models none iris iris_opt_flow tailsitter standard_vtol plane solo typhoon_h480)
set(all_posix_vmd_make_targets)
foreach(viewer ${viewers})
@@ -186,20 +171,6 @@ foreach(viewer ${viewers})
set(_targ_name "${viewer}_${model}_${debugger}")
endif()
endif()
if (debugger STREQUAL "ide" AND viewer STREQUAL "gazebo")
SET(SITL_RUNNER_SOURCE_DIR ${PX4_SOURCE_DIR})
SET(SITL_RUNNER_MODEL_FILE ${PX4_SOURCE_DIR}/${config_sitl_rcS_dir}/${model})
SET(SITL_RUNNER_WORKING_DIRECTORY ${SITL_WORKING_DIR})
CONFIGURE_FILE(${PX4_SOURCE_DIR}/src/platforms/posix/sitl_runner_main.cpp.in sitl_runner_main_${model}.cpp @ONLY)
px4_add_sitl_app(APP_NAME px4_${model}
UPLOAD_NAME upload_${model}
MAIN_SRC ${CMAKE_CURRENT_BINARY_DIR}/sitl_runner_main_${model}.cpp
)
endif()
add_custom_target(${_targ_name}
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
$<TARGET_FILE:px4>