This repository has been archived on 2021-01-10. You can view files and clone it, but cannot push or open issues or pull requests.

SDL2 CMake modules

This repository contains CMake modules for finding and using the SDL2 library as well as other related libraries:

These modules are based on the SDL (1.2) modules, with the same names, distributed with the CMake project. The SDL2_gfx module is also based on the SDL_image module.

Details and Improvements

The improvements made to these modules are as follows:

FindSDL2.cmake

  • Adapt FindSDL.cmake to SDL2 (FindSDL2.cmake).
  • Add cache variables for more flexibility:
    SDL2_PATH, SDL2_NO_DEFAULT_PATH
  • Mark Threads as a required dependency for non-OSX systems.
  • Modernize the FindSDL2.cmake module by creating specific targets:
    • SDL2::Core : Library project should link to SDL2::Core
    • SDL2::Main : Application project should link to SDL2::Main

For more details, please see the embedded documentation in FindSDL2.cmake file.

FindSDL2_<COMPONENT>.cmake

  • Adapt FindSDL_<COMPONENT>.cmake to SDL2_<COMPONENT> (FindSDL2_<COMPONENT>.cmake).
  • Add cache variables for more flexibility:
    SDL2_<COMPONENT>_PATH, SDL2_<COMPONENT>_NO_DEFAULT_PATH
  • Add SDL2 as a required dependency.
  • Modernize the FindSDL2_<COMPONENT>.cmake modules by creating specific targets:
    SDL2::Image, SDL2::TTF, SDL2::Net, SDL2::Mixer and SDL2::GFX.

For more details, please see the embedded documentation in FindSDL2_<COMPONENT>.cmake file.

Description
No description provided
Readme 64 KiB
Languages
CMake 100%