Open
Conversation
psmoveapi ships its own version of PS3EYEDriver, glm, hidapi and libusb-1.0.
It is often desirable for downstream maintainers to use their own version
of these packages. However the psmoveapi CMake configuration currently does
not allow that.
This change introduces a new `PSMOVEAPI_VENDORING` CMake variable which is
enabled by default. When it is disabled, we disable all references to the
`external/` directory across the build system and we let CMake look for its
dependencies in the usual locations.
This is still explicitly broken for Windows and Darwin as I have no access
to such systems and am not able to test whether this works.
Successfully tested on Debian 12.13:
```
$ mkdir build && cd build && cmake -DPSMOVEAPI_VENDORING=OFF ..
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Checking for module 'dbus-1'
-- Found dbus-1, version 1.14.10
-- Checking for module 'libudev'
-- Found libudev, version 252
-- Checking for module 'bluez>=5'
-- Found bluez, version 5.66
-- Checking for module 'hidapi-hidraw'
-- Found hidapi-hidraw, version 0.13.1
-- Checking for module 'glm'
-- Found glm, version 0.9.9.8
Tracker
Tracker library: Yes (OpenCV version 4.6.0)
Camera control driver: V4L2
Build configuration
Debug build: No
Library license: BSD (see README.md for details)
Additional targets
C example apps: Yes
NavCon test: Yes (using SDL2 joystick API)
-- Configuring done
-- Generating done
-- Build files have been written to: build
$ make
[ 3%] Building C object CMakeFiles/psmoveapi.dir/src/psmove.c.o
[ 6%] Building C object CMakeFiles/psmoveapi.dir/src/psmove_calibration.c.o
[ 9%] Building CXX object CMakeFiles/psmoveapi.dir/src/psmove_orientation.cpp.o
[ 12%] Building CXX object CMakeFiles/psmoveapi.dir/src/psmoveapi.cpp.o
[ 16%] Building C object CMakeFiles/psmoveapi.dir/src/daemon/moved_monitor_linux.c.o
[ 19%] Building CXX object CMakeFiles/psmoveapi.dir/src/daemon/moved_client.cpp.o
[ 22%] Building CXX object CMakeFiles/psmoveapi.dir/src/platform/psmove_port_linux.cpp.o
[ 25%] Building CXX object CMakeFiles/psmoveapi.dir/src/math/psmove_alignment.cpp.o
[ 29%] Building C object CMakeFiles/psmoveapi.dir/src/math/psmove_math.c.o
[ 32%] Building CXX object CMakeFiles/psmoveapi.dir/src/math/psmove_quaternion.cpp.o
[ 35%] Building C object CMakeFiles/psmoveapi.dir/src/math/psmove_vector.c.o
[ 38%] Linking CXX shared library libpsmoveapi.so
[ 38%] Built target psmoveapi
[ 41%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/psmove_tracker_hue_calibration.cpp.o
[ 45%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/psmove_tracker.cpp.o
[ 48%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/psmove_fusion.cpp.o
[ 51%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/tracker_helpers.cpp.o
[ 54%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/camera_control.cpp.o
[ 58%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/camera_control_driver.cpp.o
[ 61%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/camera_control_layouts.cpp.o
[ 64%] Building CXX object CMakeFiles/psmoveapi_tracker.dir/src/tracker/camera_control_driver_v4l2.cpp.o
[ 67%] Linking CXX shared library libpsmoveapi_tracker.so
[ 67%] Built target psmoveapi_tracker
[ 70%] Building CXX object CMakeFiles/psmove.dir/src/utils/psmovecli.cpp.o
[ 74%] Linking CXX executable psmove
[ 74%] Built target psmove
[ 77%] Building C object CMakeFiles/example.dir/examples/c/example.c.o
[ 80%] Linking C executable example
[ 80%] Built target example
[ 83%] Building C object CMakeFiles/multiple.dir/examples/c/multiple.c.o
[ 87%] Linking C executable multiple
[ 87%] Built target multiple
[ 90%] Building CXX object CMakeFiles/example_new_api.dir/examples/c/example_new_api.cpp.o
[ 93%] Linking CXX executable example_new_api
[ 93%] Built target example_new_api
[ 96%] Building CXX object CMakeFiles/test_navcon.dir/examples/c/test_navcon.cpp.o
[100%] Linking CXX executable test_navcon
[100%] Built target test_navcon
```
As per thp#510
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
psmoveapi ships its own version of PS3EYEDriver, glm, hidapi and libusb-1.0. It is often desirable for downstream maintainers to use their own version of these packages. However the psmoveapi CMake configuration currently does not allow that.
This change introduces a new
PSMOVEAPI_VENDORINGCMake variable which is enabled by default. When it is disabled, we disable all references to theexternal/directory across the build system and we let CMake look for its dependencies in the usual locations.This is still explicitly broken for Windows and Darwin as I have no access to such systems and am not able to test whether this works.
Successfully tested on Debian 12.13:
As per #510