🛠️🐜 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.

64 lines
2.2 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. check_required_components(SDL2)
  29. # Create SDL2::SDL2 alias for static-only builds
  30. if(TARGET SDL2::SDL2-static AND NOT TARGET SDL2::SDL2)
  31. if(CMAKE_VERSION VERSION_LESS "3.18")
  32. # FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global.
  33. add_library(SDL2::SDL2 INTERFACE IMPORTED)
  34. set_target_properties(SDL2::SDL2 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL2::SDL2-static")
  35. else()
  36. add_library(SDL2::SDL2 ALIAS SDL2::SDL2-static)
  37. endif()
  38. endif()
  39. # For compatibility with autotools sdl2-config.cmake, provide SDL2_* variables.
  40. set(SDL2_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
  41. set(SDL2_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
  42. set(SDL2_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2")
  43. set(SDL2_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@;@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@/SDL2")
  44. set(SDL2_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@")
  45. set(SDL2_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
  46. set(SDL2_LIBRARIES SDL2::SDL2)
  47. set(SDL2_STATIC_LIBRARIES SDL2::SDL2-static)
  48. set(SDL2_STATIC_PRIVATE_LIBS)
  49. set(SDL2MAIN_LIBRARY)
  50. if(TARGET SDL2::SDL2main)
  51. set(SDL2MAIN_LIBRARY SDL2::SDL2main)
  52. list(INSERT SDL2_LIBRARIES 0 SDL2::SDL2main)
  53. list(INSERT SDL2_STATIC_LIBRARIES 0 SDL2::SDL2main)
  54. endif()
  55. set(SDL2TEST_LIBRARY SDL2::SDL2test)