sdl2-cmake-scripts icon indicating copy to clipboard operation
sdl2-cmake-scripts copied to clipboard

support static link of SDL2 and pkg-config

Open rkitover opened this issue 9 years ago • 0 comments

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:

  • warn if pkg-config is not found
  • add similar code to the other two cmake modules, or factor it out
  • support sdl2-config as well (extra parsing)

rkitover avatar Oct 26 '16 22:10 rkitover