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

57 lines
2.1 KiB

  1. macro(SDL_DetectCMakePlatform)
  2. set(SDL_CMAKE_PLATFORM )
  3. # Get the platform
  4. if(WIN32)
  5. set(SDL_CMAKE_PLATFORM WINDOWS)
  6. elseif(UNIX AND NOT APPLE)
  7. if(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
  8. set(SDL_CMAKE_PLATFORM LINUX)
  9. elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*")
  10. set(SDL_CMAKE_PLATFORM FREEBSD)
  11. elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
  12. set(SDL_CMAKE_PLATFORM NETBSD)
  13. elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
  14. set(SDL_CMAKE_PLATFORM OPENBSD)
  15. elseif(CMAKE_SYSTEM_NAME MATCHES ".*GNU.*")
  16. set(SDL_CMAKE_PLATFORM GNU)
  17. elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
  18. set(SDL_CMAKE_PLATFORM BSDI)
  19. elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
  20. set(SDL_CMAKE_PLATFORM FREEBSD)
  21. elseif(CMAKE_SYSTEM_NAME MATCHES "SYSV5.*")
  22. set(SDL_CMAKE_PLATFORM SYSV5)
  23. elseif(CMAKE_SYSTEM_NAME MATCHES "Solaris.*|SunOS.*")
  24. set(SDL_CMAKE_PLATFORM SOLARIS)
  25. elseif(CMAKE_SYSTEM_NAME MATCHES "HP-UX.*")
  26. set(SDL_CMAKE_PLATFORM HPUX)
  27. elseif(CMAKE_SYSTEM_NAME MATCHES "AIX.*")
  28. set(SDL_CMAKE_PLATFORM AIX)
  29. elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
  30. set(SDL_CMAKE_PLATFORM MINIX)
  31. endif()
  32. elseif(APPLE)
  33. if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
  34. set(SDL_CMAKE_PLATFORM DARWIN)
  35. elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
  36. set(SDL_CMAKE_PLATFORM MACOSX)
  37. elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
  38. set(SDL_CMAKE_PLATFORM TVOS)
  39. elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
  40. # !!! FIXME: remove the version check when we start requiring >= 3.14.0
  41. if(CMAKE_VERSION VERSION_LESS 3.14)
  42. set(SDL_CMAKE_PLATFORM IOS)
  43. endif()
  44. endif()
  45. elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
  46. message_error("BeOS support has been removed as of SDL 2.0.2.")
  47. elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
  48. set(SDL_CMAKE_PLATFORM HAIKU)
  49. elseif(NINTENDO_3DS)
  50. set(SDL_CMAKE_PLATFORM N3DS)
  51. elseif(OS2)
  52. set(SDL_CMAKE_PLATFORM OS2)
  53. endif()
  54. if(SDL_CMAKE_PLATFORM)
  55. set(${SDL_CMAKE_PLATFORM} TRUE)
  56. endif()
  57. endmacro()