I decided to write a little program to try integrating the SDL2 source into my project. My intention was to allow this little program to be distributed via source and built on multiple platforms so I wouldn’t need to create separate binaries or have multi-leveled build process. I would like for users to just type “cmake” and it makes the whole project. Naturally I used cmake with my little program with the intent to add the SDL2 source as a subdirectory that is built as part of my cmake build script.
It appeared to work until I tried building my little program in Visual Studio 2013. I got a “Wrong SDL_config.h” error multiple times. What is the trick to building the SDL source and linking it to my project as part of my cmake build script?
Steps to reproduce (in Windows with VS 2013).
- Download my example code from github: https://github.com/CptMonkeyFist/TinyTim
- In the root folder run configure.bat
- In the newly created “build” folder, open the VS2013 solution.
- Build the solution.