tcbrindle / sdl2-cmake-scripts

CMake scripts for finding SDL2 headers and libraries on multiple platforms
327 stars 98 forks source link

support static link of SDL2 and pkg-config #9

Open rkitover opened 8 years ago

rkitover commented 8 years ago

Add SDL2_STATIC variable, when set to ON will link the static version of SDL2 and add any necessary libs and linker flags for linking it statically from pkg-config.

For dynamic linking, any extra stuff from pkg-config is also retrieved and added to SDL2_LIBRARY.

The variable SDL2_DEFINITIONS is also retrieved from pkg-config --cflags-only-other.

If pkg-config is not available, the module functions as before with no errors, but SDL2_STATIC will probably fail.

TODO: