I am currently developing some C++ GUI application using wxWidgets (although the GUI framework doesn't really matter here) and thus far have been developing this on my own, which was working well. This project has a few other dependencies as well (OpenGL, mainly, and then a few smaller ones like GoogleTest, etc.).
I am at a stage now where potentially other people will join the project (mainly students, not necessarily with a strong software engineering background) so it would be good to have a reproducible development environment where someone can pull / clone the repo, run some magic installation step and have the project set up and running on their machine.
Usually this wouldn't be a problem, there are plenty of solutions out there to cover this, but I have found that non of these work well in my current case. Let me elaborate on what isn't working for me:
Building from source is important to me. I can get with relying on some libraries being available (like OpenGL), but everything else should be build from source, not coming through a package manager like conan or vcpkg (mainly because I am using some obscure libraries that are not available, but also because it just makes sense to build your dependencies from source, see also: https://www.youtube.com/watch?v=54uVTkhinDE&ab_channel=CppCon)
I use CMake, naturally using something like subproject or fetchContent as part of CMake to build dependencies, then, would make sense. In-fact, I have used fetchContent but soon realised that not all libraries can be build with this capabilities. This has lead to ugly hacks to mack libraries work but this is far from reliable and actually causes more issues now than it solves. There is a bit of discussion on this, including my answer, here: https://stackoverflow.com/questions/66736809/wxwidgets-and-fetch-content-in-cmake
Docker would be another logical step, my experience with it is limited but I can see that it may have issues communicating a GUI through docker, there seem to be also some suggestions that Docker is not suitable for this task: Build docker images for GUI applications in Linux
Of course, there is the good old bash (unix) or powershell (win) approach, write a script that builds everything for you. This requires several (at least two) scripts if I want to target both unix and windows and also doesn't feel like a 21st-century approach. Yes, cross-platform is important to me and I want to have a single place / instruction set that is responsible for installing third-party libraries as part of the build
My least favourite option: Require that everything is already installed on the development PC which the software is then linking against (or throwing errors if the libraries are not available). As mentioned previously, my target audience are postgraduate students with not necessarily a software engineering background, this approach seems to be just creating more issues and questions which hopefully could be addressed by providing some form of automatic setup routine.
So my specific question is, in order to avoid this become an opinion-driven thread, is there a way which allows for an automatic third-party library compilation / installation stage while the software is build? I really like the fetchContent solution as it will build in either debug or release mode depending on my CMake settings, but I would be ok settling for one build type if it could be automated. My requirements are that this could happen automatically (downloading, unpacking, compilation, installation, etc.) after which the actual software can just include the libraries during the build and linking stage.
If I have missed something in the points above (especially on Docker, as I am not too familiar with it, perhaps GUI development is possible using volumes and sharing executables this way?), I would also appreciate comments on the approaches described above can be used for cross-platform gui development.