Repository navigation
Expand file tree
/
Copy pathplatform.cmake
More file actions
57 lines (53 loc) · 1.43 KB
/
Copy pathplatform.cmake
File metadata and controls
57 lines (53 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#cmake has some strange defaults, this should help us a lot
#Please use them everywhere
#WINDOWS = Windows Desktop
#WINRT = Windows RT
#WP8 = Windows Phone 8
#ANDROID = Android
#IOS = iOS
#MACOSX = MacOS X
#LINUX = Linux
#define PLATFORM_UNKNOWN 0
#define PLATFORM_IOS 1
#define PLATFORM_ANDROID 2
#define PLATFORM_WIN32 3
#define PLATFORM_WP8 4
#define PLATFORM_WIN10 5
#define PLATFORM_LINUX 6
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(WINRT)
set(SYSTEM_STRING "Windows RT")
add_definitions(-DTARGET_PLATFORM=5)
elseif(WP8)
set(SYSTEM_STRING "Windows Phone 8")
add_definitions(-DTARGET_PLATFORM=4)
else()
set(WINDOWS TRUE)
set(SYSTEM_STRING "Windows Desktop")
add_definitions(-DTARGET_PLATFORM=3)
endif()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(ANDROID)
set(SYSTEM_STRING "Android")
add_definitions(-DTARGET_PLATFORM=2)
else()
set(LINUX TRUE)
set(SYSTEM_STRING "Linux")
add_definitions(-DTARGET_PLATFORM=6)
endif()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(IOS)
set(SYSTEM_STRING "IOS")
add_definitions(-DTARGET_PLATFORM=1)
else()
set(MACOSX TRUE)
set(APPLE TRUE)
set(SYSTEM_STRING "Mac OSX")
add_definitions(-DTARGET_PLATFORM=6)
endif()
elseif (EMSCRIPTEN)
add_definitions(-DTARGET_PLATFORM=6)
else()
message(ERROR "unrecognized target platform.")
endif()
SET(CMAKE_INSTALL_RPATH "@executable_path")