cmake: add define for module name

This commit is contained in:
Julian Oes
2016-06-07 22:10:56 +02:00
committed by Lorenz Meier
parent 750b40f962
commit cdd45a7b2d
+4 -1
View File
@@ -303,6 +303,9 @@ function(px4_add_module)
if(MAIN) if(MAIN)
set_target_properties(${MODULE} PROPERTIES set_target_properties(${MODULE} PROPERTIES
COMPILE_DEFINITIONS PX4_MAIN=${MAIN}_app_main) COMPILE_DEFINITIONS PX4_MAIN=${MAIN}_app_main)
add_definitions(-DMODULE_NAME="${MAIN}")
else()
add_definitions(-DMODULE_NAME="unknown")
endif() endif()
if(INCLUDES) if(INCLUDES)
@@ -400,7 +403,7 @@ function(px4_generate_messages)
list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp) list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp)
endforeach() endforeach()
add_custom_command(OUTPUT ${msg_source_files_out} add_custom_command(OUTPUT ${msg_source_files_out}
COMMAND ${PYTHON_EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE}
Tools/px_generate_uorb_topic_files.py Tools/px_generate_uorb_topic_files.py
--sources --sources
${QUIET} ${QUIET}