ros-visualization / qt_gui_core

BSD 3-Clause "New" or "Revised" License
37 stars 76 forks source link

Remove sip dependencies for macOS #268

Closed srmainwaring closed 1 year ago

srmainwaring commented 2 years ago

This PR removes the dependency on qt_gui_cpp_sip when running macOS.

Partial fix for https://github.com/ros-visualization/python_qt_binding/issues/103. See also https://github.com/ros-visualization/python_qt_binding/pull/118 which is a pre-requisite for this change.

Qt bindings for macOS are available using PySide2. The brew formula for pyside@2 is keg only, to build and run using PySide2 set the environment variables:

export CMAKE_PREFIX_PATH=/usr/local/opt/pyside@2:$CMAKE_PREFIX_PATH
export PATH=/usr/local/opt/pyside@2/bin:$PATH
export PYTHONPATH=$PYTHONPATH:/usr/local/opt/pyside@2/lib/python3.10/site-packages

The changes to qt_gui_cpp_shiboken address include path resolution issues that caused the build to fail. The modification for the qt_gui_cpp_INCLUDE_PATH is not very satisfactory. Using the component properties Qt5Core_INCLUDE_DIRS etc. which would be preferable does not seem to work.

cottsay commented 1 year ago

This change regressed the RHEL builds (I'm more confident this time). The Shiboken CMake helper script calls find_package(PythonLibs). This change defines PYTHON_LIBRARY and PYTHON_INCLUDE_DIR, which seem to interfere with that resulting in:

-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES) (found suitable version "3.9.14", minimum required is "3.9")
-- Shiboken binding generator NOT available.
mjcarroll commented 1 year ago

I went ahead and reverted to be safe. I will re-work this to make sure that rhel isn't impacted. Thanks for catching it.