I’m hoping to start sharing my project with a few other GNU Linux and MacOS users, and so am exploring options for automating SDL2 and SDL_ttf installation. So far, I’ve had a lot of trouble finding a solution that works without requiring a lot of manual intervention on one or both systems.
I’d prefer to avoid CMake if possible, because I don’t want to spend the time to learn it right now, and because it adds a layer of abstraction that intuitively feels like overkill for my application. But if you all tell me that CMake is the only sane way to do this, I will listen!
The easiest option would be to use apt and homebrew, but it seems that the latest version of SDL2 available with apt on Ubuntu is 2.0.20, which is a deal breaker.
So I opted to install from source code, using the guidelines at SDL2/Installation - SDL Wiki.
This works well for SDL2, but when it came time to install SDL_ttf, the same procedure failed, first because I was missing g++ (my project is in C and I don’t write C++), then because I was missing automake or some components of it, and then because the header file <ft2build.h> could not be found. I fixed the first two dependencies, but haven’t bothered to try to fix this last problem, because even if I can fix it myself I have low confidence that I’d be able to successfully automate all of this for an end user.
I also tried to install SDL_ttf with apt-get. This almost worked, but the installation included a version of SDL1.2, whose header files interfere with my program’s compilation. To try to overcome that problem, I removed all of the header files except SDL_ttf.h
from the new include path. Again, this almost worked – but now the SDL2_ttf library is no longer being found and successfully linked, for reasons I don’t quite understand. Performing that kind of surgery on an installed package seems like a really bad idea anyway.
Is what I’m trying to do here not possible, or am I going about it the wrong way? As you can probably tell, I’m fairly new to this kind of thing, so apologies for my ignorance and thanks in advance for your patience