-
Notifications
You must be signed in to change notification settings - Fork 187
/
CMakeLists.txt
88 lines (71 loc) · 2.13 KB
/
CMakeLists.txt
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
cmake_minimum_required (VERSION 2.8)
IF(APPLE)
# SET(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
ENDIF()
project(Amnesia)
SET(VERSION "1.0.3")
OPTION(USERDIR_RESOURCES "Allow using local userdirectory resources" OFF)
IF("${CMAKE_SYSTEM}" MATCHES "Linux")
SET(LINUX ON)
ENDIF()
OPTION(FORCE32 "Force a 32bit compile on 64bit" OFF)
if (APPLE)
SET(FORCE32 ON)
endif()
IF(FORCE32)
if(APPLE)
SET(CMAKE_OSX_ARCHITECTURES "i386")
else()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
endif()
ENDIF()
IF(LINUX)
if(CMAKE_SIZEOF_VOID_P MATCHES "8" AND NOT(FORCE32) )
set(BIN_LIBROOT "linux64")
set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86_64")
set(BIN_RPATH "\$ORIGIN/lib64")
else()
set(BIN_LIBROOT "linux")
set(CMAKE_EXECUTABLE_SUFFIX ".bin.x86")
set(BIN_RPATH "\$ORIGIN/lib")
endif()
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH ${BIN_RPATH})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
ELSEIF(APPLE)
SET(BIN_LIBROOT "macosx")
SET(BIN_RPATH "@executable_path/../Frameworks")
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH ${BIN_RPATH})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
ENDIF()
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
# silence some annoying warnings
add_definitions(
-fno-strict-aliasing
-Wno-switch
-Wno-reorder
-Wno-unused-variable
-Wno-unused-function
)
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2013 Frictional Games")
add_subdirectory(HPL2/core core)
if(USERDIR_RESOURCES)
add_definitions(
-DUSERDIR_RESOURCES
)
endif()
add_subdirectory(Game/src/game game)
IF(APPLE)
add_subdirectory(Game/src/launcher-macosx launcher)
ELSE()
add_subdirectory(Game/src/launcher launcher)
ENDIF()
add_custom_target(BuildGame)
add_dependencies(BuildGame Amnesia Launcher)
add_custom_Target(BuildSteamGame)
add_dependencies(BuildSteamGame AmnesiaSteam Launcher)