This turned out to be the easiest way to "manually" specify where it lives. Or rather - the only way I managed to get it to work after multiple attempts.
The next is a nasty script which downloads and builds the dependencies listed in the build instructions for microsoft windows and then cross-compiles libfreenect2 itself. The problem is with generate_resources which must run on the host and well, cmake makes this simple task inordinately complex and I couldn't get it to work in the time i had the patience to give it.
So instead the script just builds generate_resources directly then does a bunch of stuff so that cmake doesn't try to rebuild it and so it can actually find it since not running build step seems to have side-effects that drop the path from the command invocation.
I managed to get libfreenect2 to cross-compile to microsoft windows target from an ubuntu 16 host using mingw-w64, this may be useful for others.
Note: I haven't tested this on any hardware yet!
First a small change to allow turbojpeg to be found using pkg-config if it finds it:
https://www.zedzone.space/patches/0002-Use-pkg-config-for-turbojpeg-if-it-is-found.patch
This turned out to be the easiest way to "manually" specify where it lives. Or rather - the only way I managed to get it to work after multiple attempts.
The next is a nasty script which downloads and builds the dependencies listed in the build instructions for microsoft windows and then cross-compiles libfreenect2 itself. The problem is with generate_resources which must run on the host and well, cmake makes this simple task inordinately complex and I couldn't get it to work in the time i had the patience to give it.
https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling#using-executables-in-the-build-created-during-the-build
So instead the script just builds generate_resources directly then does a bunch of stuff so that cmake doesn't try to rebuild it and so it can actually find it since not running build step seems to have side-effects that drop the path from the command invocation.
https://www.zedzone.space/patches/0003-Example-script-to-cross-compile-library-and-dependen.patch
Obviously this isn't intended for committing as is, it's just an example.