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

39 lines
1.8 KiB

  1. # sdl2 cmake project-config input for ./configure scripts
  2. set(prefix "@prefix@")
  3. set(exec_prefix "@exec_prefix@")
  4. set(libdir "@libdir@")
  5. set(SDL2_PREFIX "@prefix@")
  6. set(SDL2_EXEC_PREFIX "@prefix@")
  7. set(SDL2_LIBDIR "@libdir@")
  8. set(SDL2_INCLUDE_DIRS "@includedir@/SDL2")
  9. set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@")
  10. string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
  11. if(NOT TARGET SDL2::SDL2)
  12. # Remove -lSDL2 as that is handled by CMake, note the space at the end so it does not replace e.g. -lSDL2main
  13. # This may require "libdir" beeing set (from above)
  14. string(REPLACE "-lSDL2 " "" SDL2_EXTRA_LINK_FLAGS "@SDL_RLD_FLAGS@ @SDL_LIBS@ ")
  15. string(STRIP "${SDL2_EXTRA_LINK_FLAGS}" SDL2_EXTRA_LINK_FLAGS)
  16. string(REPLACE "-lSDL2 " "" SDL2_EXTRA_LINK_FLAGS_STATIC "@SDL_STATIC_LIBS@ ")
  17. string(STRIP "${SDL2_EXTRA_LINK_FLAGS_STATIC}" SDL2_EXTRA_LINK_FLAGS_STATIC)
  18. add_library(SDL2::SDL2 SHARED IMPORTED)
  19. set_target_properties(SDL2::SDL2 PROPERTIES
  20. INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
  21. IMPORTED_LINK_INTERFACE_LANGUAGES "C"
  22. IMPORTED_LOCATION "@libdir@/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}"
  23. INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS}")
  24. add_library(SDL2::SDL2-static STATIC IMPORTED)
  25. set_target_properties(SDL2::SDL2-static PROPERTIES
  26. INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
  27. IMPORTED_LINK_INTERFACE_LANGUAGES "C"
  28. IMPORTED_LOCATION "@libdir@/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}"
  29. INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS_STATIC}")
  30. add_library(SDL2::SDL2main STATIC IMPORTED)
  31. set_target_properties(SDL2::SDL2main PROPERTIES
  32. IMPORTED_LINK_INTERFACE_LANGUAGES "C"
  33. IMPORTED_LOCATION "@libdir@/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}")
  34. endif()