💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

7 years ago
  1. # - Try to find SDL2
  2. # This module defines
  3. # SDL2_FOUND - System has SDL2
  4. # SDL2_INCLUDE_DIRS - The SDL2 include directories
  5. # SDL2_LIBRARIES - Link to these to use SDL2
  6. # Copyright (C) 2011-2014 Christopher J. Howard
  7. #
  8. # This file is part of Open Graphics Framework (OGF).
  9. #
  10. # OGF is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation, either version 3 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # OGF is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with OGF. If not, see <http://www.gnu.org/licenses/>.
  22. set(SDL2_SEARCH_PATHS
  23. /)
  24. find_path(SDL2_INCLUDE_DIR SDL.h
  25. NAMES SDL2
  26. PATH_SUFFIXES include/SDL2 include
  27. PATHS ${SDL2_SEARCH_PATHS})
  28. find_library(SDL2MAIN_LIBRARY
  29. NAMES SDL2main
  30. PATH_SUFFIXES lib64 lib
  31. PATHS ${SDL2_SEARCH_PATHS})
  32. find_library(SDL2_LIBRARY
  33. NAMES SDL2
  34. PATH_SUFFIXES lib64 lib
  35. PATHS ${SDL2_SEARCH_PATHS})
  36. set(SDL2_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY})
  37. set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
  38. include(FindPackageHandleStandardArgs)
  39. find_package_handle_standard_args(
  40. SDL2 DEFAULT_MSG
  41. SDL2_LIBRARY SDL2MAIN_LIBRARY SDL2_INCLUDE_DIR)
  42. mark_as_advanced(SDL2_INCLUDE_DIR SDL2_LIBRARY SDL2MAIN_LIBRARY)