🛠️🐜 Antkeeper superbuild with dependencies included 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.

77 lines
2.5 KiB

  1. # sdl2 cmake project-config input for CMakeLists.txt script
  2. include(FeatureSummary)
  3. set_package_properties(SDL2 PROPERTIES
  4. URL "https://www.libsdl.org/"
  5. DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware"
  6. )
  7. @PACKAGE_INIT@
  8. set(SDL2_FOUND TRUE)
  9. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
  10. include("${CMAKE_CURRENT_LIST_DIR}/SDL2Targets.cmake")
  11. set(SDL2_SDL2_FOUND TRUE)
  12. endif()
  13. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
  14. if(ANDROID)
  15. enable_language(CXX)
  16. endif()
  17. include("${CMAKE_CURRENT_LIST_DIR}/SDL2staticTargets.cmake")
  18. set(SDL2_SDL2-static_FOUND TRUE)
  19. endif()
  20. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
  21. include("${CMAKE_CURRENT_LIST_DIR}/SDL2mainTargets.cmake")
  22. set(SDL2_SDL2main_FOUND TRUE)
  23. endif()
  24. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake")
  25. include("${CMAKE_CURRENT_LIST_DIR}/SDL2testTargets.cmake")
  26. set(SDL2_SDL2test_FOUND TRUE)
  27. endif()
  28. include("${CMAKE_CURRENT_LIST_DIR}/sdlfind.cmake")
  29. set(SDL_ALSA @SDL_ALSA@)
  30. set(SDL_ALSA_SHARED @SDL_ALSA_SHARED@)
  31. if(SDL_ALSA AND NOT SDL_ALSA_SHARED AND TARGET SDL2::SDL2-static)
  32. sdlFindALSA()
  33. endif()
  34. unset(SDL_ALSA)
  35. unset(SDL_ALSA_SHARED)
  36. check_required_components(SDL2)
  37. # Create SDL2::SDL2 alias for static-only builds
  38. if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2)
  39. if(CMAKE_VERSION VERSION_LESS "3.18")
  40. # FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global.
  41. add_library(SDL2::SDL2 INTERFACE IMPORTED)
  42. set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static")
  43. else()
  44. add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
  45. endif()
  46. endif()
  47. # For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables.
  48. set(SDL2_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
  49. set(SDL2_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
  50. set(SDL2_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2")
  51. set(SDL2_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@;@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2")
  52. set(SDL2_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@")
  53. set(SDL2_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
  54. set(SDL2_LIBRARIES SDL2::SDL2)
  55. set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static)
  56. set(SDL2_STATIC_PRIVATE_LIBS)
  57. set(SDL2MAIN_LIBRARY)
  58. if(TARGET SDL2::SDL2main)
  59. set(SDL2MAIN_LIBRARY SDL2::SDL2main)
  60. list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main)
  61. list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main)
  62. endif()
  63. set(SDL2TEST_LIBRARY SDL2::SDL2test)