summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2024-05-04 16:51:29 -0700
committer3gg <3gg@shellblade.net>2024-05-04 16:51:29 -0700
commit8222bfe56d4dabe8d92fc4b25ea1b0163b16f3e1 (patch)
tree763389e42276035ac134d94eb1dc32293b88d807 /src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake
Initial commit.
Diffstat (limited to 'src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake')
-rw-r--r--src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake b/src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake
new file mode 100644
index 0000000..6d8ece6
--- /dev/null
+++ b/src/contrib/SDL-2.30.2/cmake/sdlplatform.cmake
@@ -0,0 +1,59 @@
1macro(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 elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
32 set(SDL_CMAKE_PLATFORM QNX)
33 endif()
34 elseif(APPLE)
35 if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
36 set(SDL_CMAKE_PLATFORM DARWIN)
37 elseif(CMAKE_SYSTEM_NAME MATCHES ".*MacOS.*")
38 set(SDL_CMAKE_PLATFORM MACOSX)
39 elseif(CMAKE_SYSTEM_NAME MATCHES ".*tvOS.*")
40 set(SDL_CMAKE_PLATFORM TVOS)
41 elseif(CMAKE_SYSTEM_NAME MATCHES ".*iOS.*")
42 # !!! FIXME: remove the version check when we start requiring >= 3.14.0
43 if(CMAKE_VERSION VERSION_LESS 3.14)
44 set(SDL_CMAKE_PLATFORM IOS)
45 endif()
46 endif()
47 elseif(CMAKE_SYSTEM_NAME MATCHES "BeOS.*")
48 message_error("BeOS support has been removed as of SDL 2.0.2.")
49 elseif(CMAKE_SYSTEM_NAME MATCHES "Haiku.*")
50 set(SDL_CMAKE_PLATFORM HAIKU)
51 elseif(NINTENDO_3DS)
52 set(SDL_CMAKE_PLATFORM N3DS)
53 elseif(OS2)
54 set(SDL_CMAKE_PLATFORM OS2)
55 endif()
56 if(SDL_CMAKE_PLATFORM)
57 set(${SDL_CMAKE_PLATFORM} TRUE)
58 endif()
59endmacro()