|
| 1 | +How to cross-build libfreenect for Windows on e.g. Ubuntu Linux |
| 2 | + |
| 3 | +== Compile libusb (v1.0.26 or git) == |
| 4 | + |
| 5 | +Below instructions assume this is built in ~/SRC/libusb |
| 6 | + |
| 7 | + cd ~/SRC/libusb |
| 8 | + ./configure --host=x86_64-w64-mingw32 |
| 9 | + make -j5 |
| 10 | + |
| 11 | +== Compile freeglut (v3.2.2 or git) == |
| 12 | + |
| 13 | +Below instructions assume this is built in ~/SRC/freeglut |
| 14 | +https://github.com/FreeGLUTProject/freeglut/pull/98 must be applied. |
| 15 | +Follow the instructions in the README.mingw_cross exactly, only with |
| 16 | +the addition of the cmake flag |
| 17 | + -D FREEGLUT_REPLACE_GLUT=1 |
| 18 | +(Note the dll will actually end up in the bin folder) |
| 19 | + |
| 20 | +== Compile libfreenect == |
| 21 | + |
| 22 | +This can surely be improved, the system FindGLUT doesn't work well. |
| 23 | +Also the included FindThreads.cmake doesn't seem to help in this case. |
| 24 | + |
| 25 | + touch ../cmake_modules/FindGLUT.cmake |
| 26 | + |
| 27 | + cmake -D CMAKE_TOOLCHAIN_FILE=mingw.cmake \ |
| 28 | + -D LIBUSB_1_INCLUDE_DIR=~/SRC/libusb/libusb \ |
| 29 | + -D LIBUSB_1_LIBRARY=~/SRC/libusb/libusb/.libs/libusb-1.0.dll \ |
| 30 | + -D THREADS_PTHREADS_WIN32_LIBRARY=/usr/x86_64-w64-mingw32/lib/libpthread.dll.a \ |
| 31 | + -D GLUT_FOUND=1 \ |
| 32 | + -D GLUT_INCLUDE_DIR=~/SRC/freeglut/freeglut/include \ |
| 33 | + -D GLUT_LIBRARY=~/SRC/freeglut/freeglut/bin/libglut.dll \ |
| 34 | + -D CMAKE_INSTALL_PREFIX=install-win \ |
| 35 | + .. |
| 36 | + |
| 37 | + make -j5 |
| 38 | + make install |
| 39 | + find install-win |
| 40 | + |
| 41 | +This results in dynamically linked executables, so you'd need |
| 42 | +libusb.dll libglut.dll libphreads-1.0.dll on the target computer. |
| 43 | + |
0 commit comments