px4-firmware/src/firmware/posix/CMakeLists.txt

99 lines
2.3 KiB
CMake
Raw Normal View History

2015-09-08 21:50:18 -03:00
include_directories(${CMAKE_CURRENT_BINARY_DIR})
px4_posix_generate_builtin_commands(
OUT apps.h
2015-09-10 00:00:58 -03:00
MODULE_LIST ${module_libraries})
if ("${BOARD}" STREQUAL "eagle" OR ("${BOARD}" STREQUAL "excelsior"))
include(fastrpc)
include(linux_app)
FASTRPC_STUB_GEN(../qurt/px4muorb.idl)
2015-09-08 21:50:18 -03:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-prototypes -Wno-missing-declarations")
LINUX_APP(
APP_NAME mainapp
IDL_NAME px4muorb
APPS_DEST "/home/linaro"
SOURCES
px4muorb_stub.c
${CMAKE_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.h
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}/mainapp
${CMAKE_SOURCE_DIR}/posix-configs/eagle/flight/mainapp.config
2016-04-19 11:10:16 -03:00
DEPENDS mainapp
DEST /home/linaro)
else()
add_executable(mainapp
${CMAKE_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.h
)
if (NOT APPLE)
target_link_libraries(mainapp
-Wl,--start-group
${module_libraries}
${df_driver_libs}
pthread m rt
-Wl,--end-group
)
else()
target_link_libraries(mainapp
${module_libraries}
${df_driver_libs}
pthread m
)
endif()
endif()
2015-09-08 16:18:59 -03:00
add_custom_target(run_config
2015-10-24 11:57:46 -03:00
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}" "${config_sitl_debugger}"
"${config_sitl_viewer}" "${config_sitl_model}" "${CMAKE_BINARY_DIR}"
2015-10-24 11:57:46 -03:00
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
2015-10-24 11:57:46 -03:00
)
add_dependencies(run_config mainapp)
2016-01-28 17:27:49 -04:00
foreach(viewer none jmavsim gazebo replay)
2015-11-06 22:11:54 -04:00
foreach(debugger none gdb lldb ddd valgrind)
2016-03-11 11:39:02 -04:00
foreach(model none iris iris_opt_flow tailsitter standard_vtol plane)
if (debugger STREQUAL "none")
if (model STREQUAL "none")
set(_targ_name "${viewer}")
else()
set(_targ_name "${viewer}_${model}")
endif()
else()
if (model STREQUAL "none")
set(_targ_name "${viewer}___${debugger}")
else()
set(_targ_name "${viewer}_${model}_${debugger}")
endif()
endif()
add_custom_target(${_targ_name}
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}"
"${debugger}"
"${viewer}" "${model}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
)
add_dependencies(${_targ_name} mainapp)
endforeach()
endforeach()
endforeach()
2015-10-24 11:57:46 -03:00
2015-09-08 16:18:59 -03:00
# vim: set noet ft=cmake fenc=utf-8 ff=unix :