I really dislike the idea of having to install an SDK or a library to start working on my projects. That’s why i usually add libraries as submodules on my git projects and use CMake to statically link them to my application. Here’s a similar workflow:
Bullet, Assimp, GLFW and others are added as submodules and, when i CMake my project, they get built and linked together. Much easier for everyone involved, self-contained and modular.
Anyway, i’ve been looking for a way to do this with Panda without any luck. The whole building process seems very complex. Is there any way to achieve a similar workflow with this engine?
Currently, it is only supported to build Panda with makepanda. It is a straightforward process that is explained in the README.md file. What will help is the fact that you can run Panda3D straight from the “built” directory that makepanda generates, without having to install Panda3D system-wide, so you can keep the build localised to your project directory.
CMake support is in the works, and you can test it out by checking out the “cmake” branch in GitHub.
Your feedback on how we can improve this workflow is always welcome.
Having to compile Panda separately from my project, with my own compilation flags, is a nightmare for anyone working in a team and with a CI/CD workflow. Not only everyone in the team would have to keep track of how to compile Panda, and with which options, but the build server as well. In our old project, we’ve used OGRE and Bullet, and we built it like i mentioned earlier: added as a submodule, configured our Cmake project to add it as a library and linked statically. Everything was contained in our project, everything we needed to was to clone, update the submodules, and run Cmake.
I’ve checked the CMake branch, but it couldn’t understand how it worked. It seems to be building the library for dynamic linking, everytime, assuming people have to install panda on their system first, before compiling our project. This really sucks. Panda should not act like a framework or a tool, but like a library that can be easily included. Just like Bullet does.
I’m not sure I understand the issue entirely. Surely you can configure CMake to run makepanda to build Panda inside a subdirectory of your project? Again, there’s absolutely no requirement for you to install Panda into your system for you to use it. It is fully self-contained and can be run directly from the build directory.
Is there maybe something you could share about the way you set up your previous project to build OGRE and Bullet, so that I could get a better understanding of how this works? If this is something that can be improved in the way Panda is built, I’d love to look into this.
Sure, that could be done with makepanda as well, by putting the appropriate makepanda commands in the ExternalProject_Add call. (In the future it will be made even slightly easier when we merge the cmake branch into master.)
The build makepanda produces is portable and does not need to be installed in order to be used, but can be used straight out of the build directory.