Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link against Abseil for macOS builds & improve macOS compile docs #845 #905

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions COMPILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,29 @@ On Mac, the dependencies can be installed using [brew](https://brew.sh/) with th
brew install cmake qt@5 protobuf mosquitto zeromq zstd
```

If a newer version of qt is installed, you may need to temporarily link to qt5

```shell
brew link qt@5 --override
# brew link qt --override # Run once you are done building to restore the original linking
```

Add CMake into your env-vars to be detected by cmake

```shell
echo "export CPPFLAGS=\"-I/opt/homebrew/opt/qt@5/include\"" >> $HOME/.zshrc
echo "export PKG_CONFIG_PATH=\"/opt/homebrew/opt/qt@5/lib/pkgconfig\"" >> $HOME/.zshrc
echo "export LDFLAGS=\"/opt/homebrew/opt/qt@5/lib\"" >> $HOME/.zshrc
echo 'QT_HOME=$(brew --prefix qt@5) \
export CPPFLAGS="-I $QT_HOME/include" \
export PKG_CONFIG_PATH="$QT_HOME/lib/pkgconfig" \
export LDFLAGS="$QT_HOME/lib"' >> $HOME/.zshrc
```

If you don't want to permanently add them into your main file, you can try by just exporting locally in the current terminal with:

```shell
export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig"
export LDFLAGS="/opt/homebrew/opt/qt@5/lib"
QT_HOME=$(brew --prefix qt@5)
export CPPFLAGS="-I $QT_HOME/include"
export PKG_CONFIG_PATH="$QT_HOME/lib/pkgconfig"
export LDFLAGS="$QT_HOME/lib"
```

Clone the repository into **~/plotjuggler_ws**:
Expand Down
8 changes: 8 additions & 0 deletions plotjuggler_plugins/ParserProtobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ if( Protobuf_FOUND)
protobuf_parser.h
${UI_SRC} )

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(ABSL_SPINLOCK_WAIT_LIB absl_spinlock_wait)

target_link_libraries(ProtobufParser
${ABSL_SPINLOCK_WAIT_LIB}
)
facontidavide marked this conversation as resolved.
Show resolved Hide resolved
endif()

target_link_libraries(ProtobufParser
${Qt5Widgets_LIBRARIES}
${Qt5Xml_LIBRARIES}
Expand Down