cmake add better logs_symlink dependencies

This commit is contained in:
Daniel Agar
2017-04-12 19:26:06 +02:00
committed by Beat Küng
parent 2955a2c317
commit 2f6249af2f
+7 -7
View File
@@ -44,10 +44,10 @@ set(SITL_WORKING_DIR ${PX4_BINARY_DIR}/tmp)
file(MAKE_DIRECTORY ${SITL_WORKING_DIR}) file(MAKE_DIRECTORY ${SITL_WORKING_DIR})
# add a symlink to the logs dir to make it easier to find them # add a symlink to the logs dir to make it easier to find them
add_custom_target(logs_symlink ALL add_custom_command(OUTPUT ${PX4_BINARY_DIR}/logs
COMMAND ${CMAKE_COMMAND} -E create_symlink tmp/rootfs/fs/microsd/log logs COMMAND ${CMAKE_COMMAND} -E create_symlink ${SITL_WORKING_DIR}/rootfs/fs/microsd/log logs
WORKING_DIRECTORY ${PX4_BINARY_DIR} WORKING_DIRECTORY ${PX4_BINARY_DIR})
) add_custom_target(logs_symlink DEPENDS ${PX4_BINARY_DIR}/logs)
add_custom_target(run_config add_custom_target(run_config
COMMAND Tools/sitl_run.sh COMMAND Tools/sitl_run.sh
@@ -60,8 +60,8 @@ add_custom_target(run_config
${PX4_BINARY_DIR} ${PX4_BINARY_DIR}
WORKING_DIRECTORY ${SITL_WORKING_DIR} WORKING_DIRECTORY ${SITL_WORKING_DIR}
USES_TERMINAL USES_TERMINAL
DEPENDS px4 logs_symlink
) )
add_dependencies(run_config px4)
# project to build sitl_gazebo if necessary # project to build sitl_gazebo if necessary
ExternalProject_Add(sitl_gazebo ExternalProject_Add(sitl_gazebo
@@ -80,8 +80,7 @@ ExternalProject_Add_Step(sitl_gazebo forceconfigure
# create targets for each viewer/model/debugger combination # create targets for each viewer/model/debugger combination
set(viewers none jmavsim gazebo replay) set(viewers none jmavsim gazebo replay)
set(debuggers none ide gdb lldb ddd valgrind callgrind) set(debuggers none ide gdb lldb ddd valgrind callgrind)
set(models none iris iris_opt_flow iris_rplidar set(models none iris iris_opt_flow iris_rplidar standard_vtol plane solo tailsitter typhoon_h480 rover)
standard_vtol plane solo tailsitter typhoon_h480 rover)
set(all_posix_vmd_make_targets) set(all_posix_vmd_make_targets)
foreach(viewer ${viewers}) foreach(viewer ${viewers})
foreach(debugger ${debuggers}) foreach(debugger ${debuggers})
@@ -125,6 +124,7 @@ foreach(viewer ${viewers})
${PX4_BINARY_DIR} ${PX4_BINARY_DIR}
WORKING_DIRECTORY ${SITL_WORKING_DIR} WORKING_DIRECTORY ${SITL_WORKING_DIR}
USES_TERMINAL USES_TERMINAL
DEPENDS logs_symlink
) )
list(APPEND all_posix_vmd_make_targets ${_targ_name}) list(APPEND all_posix_vmd_make_targets ${_targ_name})
if (viewer STREQUAL "gazebo") if (viewer STREQUAL "gazebo")