So far, I’ve been using Urho as a dependency on my machine. I did the standard make && make install and everything works well on my both Fedora and Manjaro setups. However, now that I’m ready to package my project and make it more mature, I wanted to add Urho as an external dependency to my build, so contributors can just clone my repo and run CMake and call it a day. This will be much better for Mac and Windows contributors too.
Unfortunately, I can’t get ExternalProject_Add to work with Urho. It fails to find paths and I can’t compile it as a static dependency. I also tried with a git submodule and add_subdirectory, but had the same errors. I suspect the problem lies within the Urho standard CMakeLists.txt.
When searching in a non-default SDK installation or when searching in any Urho3D project build tree then the actual location need to be provided via URHO3D_HOME environment variable (set in the host system) or URHO3D_HOME build option (set using -D at command line or in cmake-gui). That is, use the URHO3D_HOME to hint the build system to locate the library.
Last not least, you also need to copy/mklink CMake folder from Urho3D to the folder of your project.
You can use the Android NDK to generate standalone toolchain for your target arch and build Urho3D as static with the toolchain. You can do that for every arch you want to target (aarch64 and armeabi-v7a for example) and use those libraries in both windows and linux with Android Studio. That’s what I do in my project and its automated, so once I had it done its quite easy now.
Here’s a snippet of how I build it using ExternalProject_Add: