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

54 lines
1.2 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})
2015-09-08 21:50:18 -03:00
add_executable(mainapp
${CMAKE_SOURCE_DIR}/src/platforms/posix/main.cpp
apps.h
)
2015-09-08 21:50:18 -03:00
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR NOT APPLE)
target_link_libraries(mainapp
-Wl,--start-group
${module_libraries}
pthread m rt
-Wl,--end-group
)
else()
target_link_libraries(mainapp
${module_libraries}
pthread m
)
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}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
2015-10-24 11:57:46 -03:00
)
add_dependencies(run_config mainapp)
foreach(viewer jmavsim gazebo)
foreach(debugger none gdb lldb)
if (debugger STREQUAL "none")
set(_targ_name "${viewer}")
else()
set(_targ_name "${viewer}_${debugger}")
endif()
add_custom_target(${_targ_name}
COMMAND Tools/sitl_run.sh "${config_sitl_rcS}"
"${debugger}"
"${viewer}" "${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
USES_TERMINAL
)
add_dependencies(${_targ_name} mainapp)
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 :