Skip to content

Commit

Permalink
Merge pull request #4 from PX4/pr-fix-zmq
Browse files Browse the repository at this point in the history
Tolerating no ZMQ, Protobuf version
  • Loading branch information
farhangnaderi authored Jan 13, 2025
2 parents 591a756 + 82f5f48 commit 4b80c0e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
rm -rf /usr/local/var/homebrew/locks
brew cleanup -s
brew update
brew install mosquitto zeromq qt@5
brew install mosquitto zeromq qt@5 protobuf@21
- name: Build PlotJuggler
run: |
Expand Down
4 changes: 2 additions & 2 deletions COMPILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ docker buildx build -o . .
On Mac, the dependencies can be installed using [brew](https://brew.sh/) with the following command:

```shell
brew install cmake qt@5 protobuf mosquitto zeromq zstd
brew install cmake qt@5 protobuf@21 mosquitto zeromq zstd
```

If you have multiple versions of Qt installed (e.g., `qt` and `qt@5`), you may need to explicitly link `qt@5` to ensure it is found by CMake. Use the following commands:
Expand Down Expand Up @@ -120,7 +120,7 @@ export LDFLAGS="$QT_HOME/lib"
Clone the repository into **~/plotjuggler_ws**:

```shell
git clone https://github.com/PX4/PlotJuggler.git ~/plotjuggler_ws/src/PlotJuggler
git clone https://github.com/facontidavide/PlotJuggler.git ~/plotjuggler_ws/src/PlotJuggler
cd ~/plotjuggler_ws
```

Expand Down
32 changes: 18 additions & 14 deletions plotjuggler_plugins/DataStreamZMQ/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@ elseif(BUILDING_WITH_CONAN)
message(STATUS "Finding ZeroMQ with conan")
else()
message(STATUS "Finding ZeroMQ without package managers")
set(ZeroMQ_LIBS ${ZeroMQ_LIBRARIES})
endif()

find_package(ZeroMQ QUIET)

if(ZeroMQ_FOUND)
# message(STATUS "[ZeroMQ] found")
message(STATUS "[ZeroMQ] found at ${ZeroMQ_INCLUDE_DIR} and ${ZeroMQ_LIBRARY}")

# add_definitions(${QT_DEFINITIONS})
# add_definitions(-DQT_PLUGIN)
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
include_directories(${ZeroMQ_INCLUDE_DIR})

# QT5_WRAP_UI ( UI_SRC datastream_zmq.ui )
QT5_WRAP_UI(UI_SRC datastream_zmq.ui)

# add_library(DataStreamZMQ SHARED datastream_zmq.cpp ${UI_SRC} )
add_library(DataStreamZMQ SHARED datastream_zmq.cpp ${UI_SRC})

# target_link_libraries(DataStreamZMQ ${Qt5Widgets_LIBRARIES} plotjuggler_base)
target_link_libraries(DataStreamZMQ
${Qt5Widgets_LIBRARIES}
plotjuggler_base
${ZeroMQ_LIBRARIES}
)

# if(BUILDING_WITH_VCPKG OR BUILDING_WITH_CONAN)
# target_link_libraries(DataStreamZMQ libzmq-static)
# else()
# target_link_libraries(DataStreamZMQ ${ZeroMQ_LIBRARIES})
# endif()
if(BUILDING_WITH_VCPKG OR BUILDING_WITH_CONAN)
target_link_libraries(DataStreamZMQ libzmq-static)
endif()

# install(TARGETS DataStreamZMQ DESTINATION ${PJ_PLUGIN_INSTALL_DIRECTORY} )
install(TARGETS DataStreamZMQ
DESTINATION ${PJ_PLUGIN_INSTALL_DIRECTORY}
)
else()
message("[ZeroMQ] not found. Skipping plugin DataStreamZMQ.")
message(WARNING "[ZeroMQ] not found. Skipping plugin DataStreamZMQ.")
endif()

0 comments on commit 4b80c0e

Please sign in to comment.