OSVR / OSVR-Core

The core libraries, applications, and plugins of the OSVR software platform.
Apache License 2.0
330 stars 124 forks source link

Android build re-downloads OpenCV on every rebuild #141

Closed janoc closed 9 years ago

janoc commented 9 years ago

CMake forces download of OpenCV on every rebuild, even if nothing has changed, slowing the build down considerably for no reason.

A simple solution would be to pre-download all such dependencies in the configure.cmd and configure-gui.cmd batches instead, working around the CMake issues.

rpavlik commented 9 years ago

So this really was an issue in https://github.com/OSVR/OSVR-Android-Build rather than this project, but no matter. Some weirdness in the ExternalProject.cmake stuff, potentially related to the uppercase nature of my SHA hash (!) but I could simplify. I solved this (wrote my own downloader CMake script that is considerably more polite in trying to avoid downloads, and copies a valid download back into the source tree where it is gitignored, so it can be shared between builds) in the commits I pushed yesterday.

I also improved and documented those (optional) build batch scripts. I now highly recommend using Ninja, and there's a build script that will "do the right thing" if run in a Visual Studio command prompt, no need for MinGW to use the automated scripts like there was before.

janoc commented 9 years ago

Ah sorry, I filed it on a wrong project. Thanks for fixing this, it was a really annoying problem.

BTW, careful about ninja - I had some bad experience with it breaking/doing wrong things in case of parallel builds.

rpavlik commented 9 years ago

Yeah, I had a few minor issues related to the custom download step, and I've had projects it won't build right before, but it does build this just fine, and in any case, changing away from it for child projects is just a drop-down menu in the CMake GUI (or a command-line argument). And, if you're really nervous, there's now even a script to use nmake. (Mind you, basically all the configure scripts besides the mingw one are trivial, since they don't have to specify the path to their build tool, but...)