Rework build system regarding libvgm
Currently, building SMPSPlay requires some odd shenanigans with having to build libvgm separately, and having to pass in the include directory into the main CMake command. Since the SMPSPlay libvgm is a fork, it should be reworked so that libvgm is compiled as a CMake library, that way it can be compiled, included, and linked via the main CMakeLists.txt, rather than the current system in place. Unless there is some other reason as to why the system should be like this, this should be something to be looked into, as the current system is both difficult to use and implement for other projects.
The SMPSPlay libvgm is not a fork - it's a submodule. (with a certain commit being pinned, that is confirmed to work with SMPSPlay)
The workflow is this:
- build + install libvgm using the scripts
- during the process, it will register libvgm as a CMake module in the local CMake database
- configure SMPSPlay, it should find libvgm automatically by itself
- build SMPSPlay
If something of this doesn't work, then I'll need to have a look into it. (and probably clear some caches)
The submodule links to a libvgm fork. What I'm saying is that the main CMakeLists.txt should handle the libvgm library rather than it being done externally
I still don't get what you want.
Can you elaborate on that and make an example?
I think what he means is make cmake handle the building and install automatically so you only have to run cmake to get everything setup to build. Since libvgm is a git repo, you can configure it to automatically download the repo within cmake and build it Then cmake should be able to use the repo it downloaded to finish the rest of the compilation This cuts down the amount of steps the user has to do down to just running cmake and building like normal
gtest actually uses this method which is where i learned about it. There should be more info about it here too https://github.com/Crascit/DownloadProject
Feel free to make a proof-of-concept of what you think and show it to me. Then I'll see whether or not I'll integrate it.
Instead of having to use scripts externally, SMPSPlay's CMakeLists would be able to handle configuring the libvgm dependency itself.
CMake allows you to include other lists, to combine projects and dependencies, using include().
@lilggamegenius is also saying that you can use an external CMake module to clone the submodule automatically.