diff --git a/Makefile b/Makefile index 2a0e843f94..5e68ee3c42 100644 --- a/Makefile +++ b/Makefile @@ -161,7 +161,8 @@ clean: # targets handled by cmake cmake_targets = test upload package package_source debug debug_tui debug_ddd debug_io debug_io_tui debug_io_ddd check_weak \ - run_sitl config + run_cmake_config config gazebo gazebo_gdb gazebo_lldb jmavsim \ + jmavsim_gdb jmavsim_lldb $(foreach targ,$(cmake_targets),$(eval $(call cmake-targ,$(targ)))) .PHONY: clean diff --git a/src/firmware/posix/CMakeLists.txt b/src/firmware/posix/CMakeLists.txt index 88028d176e..59398c2668 100644 --- a/src/firmware/posix/CMakeLists.txt +++ b/src/firmware/posix/CMakeLists.txt @@ -24,12 +24,32 @@ else() ) endif() -add_custom_target(run_sitl +add_custom_target(run_config COMMAND Tools/sitl_run.sh "${config_sitl_rcS}" "${config_sitl_debugger}" "${config_sitl_viewer}" "${CMAKE_BINARY_DIR}" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} USES_TERMINAL ) -add_dependencies(run_sitl mainapp) +add_dependencies(run_config mainapp) + +foreach(viewer jmavsim gazebo) + foreach(debugger none gdb lldb) + message(STATUS "viewer: ${viewer}") + message(STATUS "debugger: ${debugger}") + 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() # vim: set noet ft=cmake fenc=utf-8 ff=unix :