Integrating SDL2 Source into a project with CMake |
balornt
|
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). 1. Download my example code from github: https://github.com/CptMonkeyFist/TinyTim 2. In the root folder run configure.bat 3. In the newly created "build" folder, open the VS2013 solution. 4. Build the solution. |
|||||||||||
|
SOLVED |
Integrating SDL2 Source into a project with CMake |
Daniel Gibson
Guest
|
Using SDL2 with cmake currently sucks because cmake doesn't provide a
FindSDL2.cmake and SDL2 doesn't provide it (or anything else for integration) either. So people usually end up copying a FindSDL2.cmake from some other project (originally based on FindSDL.cmake for SDL1.2 that's shipped with cmake), but that's not really great of course.. https://bugzilla.libsdl.org/show_bug.cgi?id=2464 has a patch that is supposed to fix that problem, but hasn't been merged yet. Cheers, Daniel On 05/02/2015 05:56 AM, balornt wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Integrating SDL2 Source into a project with CMake |
Martin Gerhardy
Guest
|
+1 from my side, too.
Am 08.05.2015 um 21:06 schrieb Daniel Gibson:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|