forked from facontidavide/PlotJuggler
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds runners for both Intel and Apple silicon macs --------- Co-authored-by: Daniel Agar <[email protected]> Co-authored-by: Ramon Roche <[email protected]>
- Loading branch information
1 parent
f4f9d41
commit 5f77b1a
Showing
6 changed files
with
89 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,41 @@ | ||
name: macos | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
|
||
macos-build: | ||
runs-on: ${{ matrix.macos-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
macos-version: | ||
- 'macos-latest' | ||
os: | ||
- macos-13 | ||
- macos-latest | ||
|
||
steps: | ||
- name: Sync repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache Qt | ||
id: cache-qt | ||
uses: actions/cache@v1 # not v2! | ||
with: | ||
path: '${{ github.workspace }}/qt_installation/' | ||
key: ${{ runner.os }}-QtCache | ||
- name: Prepare Homebrew and Install Dependencies | ||
run: | | ||
rm -rf /usr/local/var/homebrew/locks | ||
brew cleanup -s | ||
brew update | ||
brew install mosquitto zeromq qt@5 | ||
- name: Install Qt | ||
uses: jurplel/[email protected] | ||
with: | ||
version: '5.15.2' | ||
host: 'mac' | ||
dir: '${{ github.workspace }}/qt_installation/' | ||
cached: ${{ steps.cache-qt.outputs.cache-hit }} | ||
- name: Build PlotJuggler | ||
run: | | ||
export CMAKE_PREFIX_PATH=$(brew --prefix qt@5):$(brew --prefix zeromq) | ||
export LDFLAGS="-L/usr/local/opt/zeromq/lib" | ||
export CPPFLAGS="-I/usr/local/opt/zeromq/include" | ||
export LIBRARY_PATH=/usr/local/opt/zeromq/lib | ||
export CPATH=/usr/local/opt/zeromq/include | ||
- name: Build Plotjuggler | ||
shell: pwsh | ||
run: > | ||
cmake -B build -DCMAKE_INSTALL_PREFIX=install PlotJuggler; | ||
cmake -B build -DCMAKE_INSTALL_PREFIX=install PlotJuggler | ||
cmake --build build --target install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,54 @@ | ||
# Check for vcpkg, conan, or manual build environments | ||
if(BUILDING_WITH_VCPKG) | ||
message(STATUS "Finding ZeroMQ with vcpkg") | ||
elseif(BUILDING_WITH_CONAN) | ||
message(STATUS "Finding ZeroMQ with conan") | ||
else() | ||
message(STATUS "Finding ZeroMQ without package managers") | ||
set(ZeroMQ_LIBS ${ZeroMQ_LIBRARIES}) | ||
|
||
# Find ZeroMQ using PkgConfig | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(ZMQ REQUIRED libzmq) | ||
|
||
# Set the ZeroMQ libraries and include directories for manual configuration | ||
set(ZeroMQ_LIBRARIES ${ZMQ_LIBRARIES}) | ||
set(ZeroMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIRS}) | ||
set(ZeroMQ_LIBRARY_DIRS /opt/homebrew/lib) # Add this line | ||
|
||
# Add the library path explicitly | ||
link_directories(${ZeroMQ_LIBRARY_DIRS}) # Add this line | ||
endif() | ||
|
||
# Find ZeroMQ library | ||
find_package(ZeroMQ QUIET) | ||
|
||
# Check if ZeroMQ was found | ||
if(ZeroMQ_FOUND) | ||
message(STATUS "[ZeroMQ] found") | ||
|
||
# Add QT definitions if needed | ||
add_definitions(${QT_DEFINITIONS}) | ||
add_definitions(-DQT_PLUGIN) | ||
|
||
QT5_WRAP_UI ( UI_SRC datastream_zmq.ui ) | ||
# Wrap the UI file for Qt | ||
QT5_WRAP_UI(UI_SRC datastream_zmq.ui) | ||
|
||
add_library(DataStreamZMQ SHARED datastream_zmq.cpp ${UI_SRC} ) | ||
# Add the DataStreamZMQ library | ||
add_library(DataStreamZMQ SHARED datastream_zmq.cpp ${UI_SRC}) | ||
|
||
# Link Qt5Widgets and the plotjuggler_base target to DataStreamZMQ | ||
target_link_libraries(DataStreamZMQ ${Qt5Widgets_LIBRARIES} plotjuggler_base) | ||
|
||
# Handle different library linking for vcpkg, conan, or manual builds | ||
if(BUILDING_WITH_VCPKG OR BUILDING_WITH_CONAN) | ||
target_link_libraries(DataStreamZMQ libzmq-static) | ||
else() | ||
target_link_libraries(DataStreamZMQ ${ZeroMQ_LIBRARIES}) | ||
target_include_directories(DataStreamZMQ PRIVATE ${ZeroMQ_INCLUDE_DIRS}) | ||
target_link_libraries(DataStreamZMQ zmq) # Changed this to just 'zmq' | ||
endif() | ||
|
||
install(TARGETS DataStreamZMQ DESTINATION ${PJ_PLUGIN_INSTALL_DIRECTORY} ) | ||
# Install the plugin | ||
install(TARGETS DataStreamZMQ DESTINATION ${PJ_PLUGIN_INSTALL_DIRECTORY}) | ||
else() | ||
message("[ZeroMQ] not found. Skipping plugin DataStreamZMQ.") | ||
message(STATUS "[ZeroMQ] not found. Skipping plugin DataStreamZMQ.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters