Index: lib/MsgUtils/CMakeLists.txt =================================================================== diff -u -rf5f12f4bdcca0be94e5e306f0a7af1fe0d8c874a -rfde01bd195d14da4c7a68f4e137c8ffb60094c73 --- lib/MsgUtils/CMakeLists.txt (.../CMakeLists.txt) (revision f5f12f4bdcca0be94e5e306f0a7af1fe0d8c874a) +++ lib/MsgUtils/CMakeLists.txt (.../CMakeLists.txt) (revision fde01bd195d14da4c7a68f4e137c8ffb60094c73) @@ -12,14 +12,24 @@ endif() find_package(Protobuf COMPONENTS REQUIRED) +find_package(Python3 REQUIRED COMPONENTS Interpreter) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network SerialBus) set(MSGUTILS_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts) include(cmake/MsgUtils.cmake) -# set(DENALI_MSG_CSV ${CMAKE_CURRENT_SOURCE_DIR}/../../data/FW_Messages_List.csv) +# install the Python package in editable mode so that the generated protobuf files can be imported by the Python scripts +# without needing to be copied to the Python package directory +execute_process( + COMMAND ${Python3_EXECUTABLE} -m pip install -e ${MSGUTILS_SCRIPTS_DIR} --quiet + RESULT_VARIABLE _pip_result +) +if(NOT _pip_result EQUAL 0) + message(FATAL_ERROR "Failed to install msgutils Python package (pip returned ${_pip_result})") +endif() +# set(DENALI_MSG_CSV ${CMAKE_CURRENT_SOURCE_DIR}/../../data/FW_Messages_List.csv) set(LEAHI_MSG_CSV ${CMAKE_CURRENT_SOURCE_DIR}/../../data/Leahi_Staging_FW_Messages_List.csv) set(LEAHI_MSG_CONF ${CMAKE_CURRENT_SOURCE_DIR}/../../data/Unhandled.conf)