Commit eea5c0c
Adrien Kunysz
Allow disabling vendoring.
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 #5101 parent b0d50ba commit eea5c0c
4 files changed
Lines changed: 44 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | | - | |
14 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
72 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
73 | 84 | | |
74 | 85 | | |
75 | 86 | | |
| |||
93 | 104 | | |
94 | 105 | | |
95 | 106 | | |
96 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
0 commit comments