Hi there, I’ve never used CMake before so I’m a little confused as to how to use the Urho3D build system to make my project cross-platform. I’ve read “building urho3d library”, “using urho3d library”, and Setting up a Project (CMake) several times and this is my understanding of the process:
- Download Urho3D source, this is the universal package for any platform
- Run one of the .bat, .sh, or cmake-gui to create a platform- and IDE-specific “build tree”
- Open VS solution/use make/etc to build engine from the build tree
- Create own project, use same scripts but specify URHO3D_HOME to use built engine
From my understanding of this, my C++ files would be too far “downstream” to be moved to a different platform easily, since they’re in a project that is attached to a platform-specific build. First of all, is that a correct assessment? If so, I feel like a possible solution would be to edit the CMake files of the original Urho source to include my files, so whenever I use CMake to generate a build tree for whatever platform, my files are already in there. However, I don’t know if this is the actual “correct” solution, and if it is I don’t know enough CMake to know how to do that. Another way that might work would be to manually move my code between pre-built build trees; it seems messy but I’ll do it if that’s what I gotta do. Ideally I’d like to have one folder I can move around onto any platform and have the CMake scripts generate the files I need for whatever build system, just like the source does now but with my project included.
Some minor questions that are less important than my main one and can be ignored: I am also confused about the necessity of “project scaffolding” as described in “using Urho3D library”. It seems like CMake already generates all the folders for you - why would you need to create them yourself? Also, what is the difference between Urho3D and Urho3D SDK? Is the term SDK used to mean one of the pre-built things you can download instead of the source?
Thanks for reading, I know I’m a little stupid (I think I confused myself even more in writing this post) and more than likely am missing something obvious, but I’ve been stuck reading those 3 guides for the past 2 days and I can’t wrap my head around it. Any clarification of things I’ve misunderstood is extremely welcome, and I just wanna say from spending a couple weeks going through the source and playing around editing samples (in Windows and Linux) I am absolutely in love with this engine and want to learn it from the inside out, and hopefully get good enough to contribute!