uorb generate interally set required paths

This commit is contained in:
Daniel Agar 2015-10-12 10:47:09 -04:00
parent 2c1e999e1a
commit e8fd711a5c
2 changed files with 8 additions and 4 deletions

View File

@ -43,6 +43,11 @@ import shutil
import filecmp
import argparse
import sys
px4_tools_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(px4_tools_dir + "/genmsg/src")
sys.path.append(px4_tools_dir + "/gencpp/src")
try:
import genmsg.template_tools
except ImportError as e:

View File

@ -330,7 +330,6 @@ function(px4_generate_messages)
if(NOT VERBOSE)
set(QUIET "-q")
endif()
set(PYTHONPATH "${CMAKE_SOURCE_DIR}/Tools/genmsg/src:${CMAKE_SOURCE_DIR}/Tools/gencpp/src:$ENV{PYTHONPATH}")
set(msg_out_path ${CMAKE_BINARY_DIR}/src/modules/uORB/topics)
set(msg_list)
foreach(msg_file ${MSG_FILES})
@ -342,7 +341,7 @@ function(px4_generate_messages)
list(APPEND msg_files_out ${msg_out_path}/${msg}.h)
endforeach()
add_custom_command(OUTPUT ${msg_files_out}
COMMAND PYTHONPATH=${PYTHONPATH} ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON_EXECUTABLE}
Tools/px_generate_uorb_topic_headers.py
${QUIET}
-d msg
@ -363,7 +362,7 @@ function(px4_generate_messages)
list(APPEND msg_multi_files_out ${msg_multi_out_path}/px4_${msg}.h)
endforeach()
add_custom_command(OUTPUT ${msg_multi_files_out}
COMMAND PYTHONPATH=${PYTHONPATH} ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON_EXECUTABLE}
Tools/px_generate_uorb_topic_headers.py
${QUIET}
-d msg
@ -425,7 +424,7 @@ function(px4_add_upload)
endif()
px4_join(OUT serial_ports LIST "${serial_ports}" GLUE ",")
add_custom_target(${OUT}
COMMAND PYTHONPATH=${PYTHONPATH} ${PYTHON_EXECUTABLE}
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_SOURCE_DIR}/Tools/px_uploader.py --port ${serial_ports} ${BUNDLE}
DEPENDS ${BUNDLE}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}