|
@@ -0,0 +1,116 @@
|
|
1
|
+# Set Source files
|
|
2
|
+set (SRCS ${SRCS} Camera.cpp)
|
|
3
|
+set (SRCS ${SRCS} Emitter.cpp)
|
|
4
|
+set (SRCS ${SRCS} GLString.cpp)
|
|
5
|
+set (SRCS ${SRCS} MatMath.cpp)
|
|
6
|
+set (SRCS ${SRCS} Matrix.cpp)
|
|
7
|
+set (SRCS ${SRCS} Mesh.cpp)
|
|
8
|
+set (SRCS ${SRCS} Network.cpp)
|
|
9
|
+set (SRCS ${SRCS} OpenRaider.cpp)
|
|
10
|
+set (SRCS ${SRCS} Particle.cpp)
|
|
11
|
+set (SRCS ${SRCS} Quaternion.cpp)
|
|
12
|
+set (SRCS ${SRCS} Render.cpp)
|
|
13
|
+set (SRCS ${SRCS} SDLSystem.cpp)
|
|
14
|
+set (SRCS ${SRCS} SkeletalModel.cpp)
|
|
15
|
+set (SRCS ${SRCS} Sound.cpp)
|
|
16
|
+set (SRCS ${SRCS} System.cpp)
|
|
17
|
+set (SRCS ${SRCS} Texture.cpp)
|
|
18
|
+set (SRCS ${SRCS} TombRaider.cpp)
|
|
19
|
+set (SRCS ${SRCS} Vector3d.cpp)
|
|
20
|
+set (SRCS ${SRCS} ViewVolume.cpp)
|
|
21
|
+set (SRCS ${SRCS} World.cpp)
|
|
22
|
+set (SRCS ${SRCS} tga.cpp)
|
|
23
|
+
|
|
24
|
+# Apple specific bundling
|
|
25
|
+if (APPLE)
|
|
26
|
+ # Mac Bundle Data
|
|
27
|
+ set (MACOSX_BUNDLE_INFO_STRING "OpenSource TombRaider Game Engine")
|
|
28
|
+ set (MACOSX_BUNDLE_ICON_FILE "AppIcon")
|
|
29
|
+ set (MACOSX_BUNDLE_GUI_IDENTIFIER "de.xythobuz.OpenRaider")
|
|
30
|
+ set (MACOSX_BUNDLE_LONG_VERSION_STRING "${OpenRaider_VERSION_MAJOR}.${OpenRaider_VERSION_MINOR}.${OpenRaider_VERSION_MICRO}")
|
|
31
|
+ set (MACOSX_BUNDLE_BUNDLE_NAME "OpenRaider")
|
|
32
|
+ set (MACOSX_BUNDLE_SHORT_VERSION_STRING "${OpenRaider_VERSION_MAJOR}.${OpenRaider_VERSION_MINOR}.${OpenRaider_VERSION_MICRO}")
|
|
33
|
+ set (MACOSX_BUNDLE_BUNDLE_VERSION "${OpenRaider_VERSION_MAJOR}.${OpenRaider_VERSION_MINOR}.${OpenRaider_VERSION_MICRO}")
|
|
34
|
+ set (MACOSX_BUNDLE_COPYRIGHT "2001 - 2014")
|
|
35
|
+
|
|
36
|
+ # Copy Icon
|
|
37
|
+ set (MAC_ICON "../data/AppIcon.icns")
|
|
38
|
+ set_source_files_properties(${MAC_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
|
39
|
+ set (SRCS ${SRCS} ${MAC_ICON})
|
|
40
|
+endif (APPLE)
|
|
41
|
+
|
|
42
|
+# Add Executable
|
|
43
|
+add_executable (OpenRaider MACOSX_BUNDLE ${SRCS})
|
|
44
|
+
|
|
45
|
+# Debug build warnings
|
|
46
|
+set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
|
|
47
|
+set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
|
|
48
|
+set (WARNINGS "${WARNINGS} -Wno-documentation-unknown-command -Wno-c++98-compat-pedantic")
|
|
49
|
+set (WARNINGS "${WARNINGS} -Wno-missing-prototypes -Wno-missing-variable-declarations")
|
|
50
|
+set (WARNINGS "${WARNINGS} -Wno-disabled-macro-expansion")
|
|
51
|
+
|
|
52
|
+set (WARNINGS "${WARNINGS} -Wno-shorten-64-to-32 -Wno-sign-conversion")
|
|
53
|
+
|
|
54
|
+# Flags for all builds
|
|
55
|
+set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11")
|
|
56
|
+set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -DUSING_EMITTER")
|
|
57
|
+
|
|
58
|
+# Flags for Debug build
|
|
59
|
+set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -g -O0 ${WARNINGS}")
|
|
60
|
+set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DDEBUG")
|
|
61
|
+set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DEXPERIMENTAL")
|
|
62
|
+
|
|
63
|
+# Flags for Releasae builds
|
|
64
|
+set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -ffast-math -funroll-loops")
|
|
65
|
+set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -fomit-frame-pointer -O2")
|
|
66
|
+
|
|
67
|
+# Apply Flags
|
|
68
|
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenRaider_CXX_FLAGS}")
|
|
69
|
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OpenRaider_CXX_FLAGS} ${OpenRaider_CXX_FLAGS_DEBUG}")
|
|
70
|
+set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenRaider_CXX_FLAGS} ${OpenRaider_CXX_FLAGS_RELEASE}")
|
|
71
|
+
|
|
72
|
+# Include directory
|
|
73
|
+include_directories ("${PROJECT_SOURCE_DIR}/include")
|
|
74
|
+
|
|
75
|
+# Include External Modules
|
|
76
|
+set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
|
77
|
+
|
|
78
|
+# Add Math Library
|
|
79
|
+set (LIBS ${LIBS} m)
|
|
80
|
+
|
|
81
|
+# Add SDL2 Library
|
|
82
|
+find_package (SDL2 REQUIRED)
|
|
83
|
+include_directories (SYSTEM ${SDL2_INCLUDE_DIR})
|
|
84
|
+set (LIBS ${LIBS} ${SDL2_LIBRARY})
|
|
85
|
+
|
|
86
|
+# Add SDL2_ttf Library
|
|
87
|
+find_package (SDL2TTF REQUIRED)
|
|
88
|
+include_directories (SYSTEM ${SDL2TTF_INCLUDE_DIR})
|
|
89
|
+set (LIBS ${LIBS} ${SDL2TTF_LIBRARY})
|
|
90
|
+
|
|
91
|
+# Add OpenGL Library
|
|
92
|
+find_package (OpenGL REQUIRED)
|
|
93
|
+include_directories (SYSTEM ${OPENGL_INCLUDE_DIRS})
|
|
94
|
+set (LIBS ${LIBS} ${OPENGL_LIBRARIES})
|
|
95
|
+
|
|
96
|
+# Add OpenAL Library
|
|
97
|
+find_package (OpenAL REQUIRED)
|
|
98
|
+include_directories (SYSTEM ${OPENAL_INCLUDE_DIRS})
|
|
99
|
+set (LIBS ${LIBS} ${OPENAL_LIBRARIES})
|
|
100
|
+
|
|
101
|
+# Add ALUT Library
|
|
102
|
+find_package (ALUT REQUIRED)
|
|
103
|
+include_directories (SYSTEM ${ALUT_INCLUDE_DIRS})
|
|
104
|
+set (LIBS ${LIBS} ${ALUT_LIBRARIES})
|
|
105
|
+
|
|
106
|
+# Add Z Library
|
|
107
|
+find_package (ZLIB REQUIRED)
|
|
108
|
+include_directories (SYSTEM ${ZLIB_INCLUDE_DIRS})
|
|
109
|
+set (LIBS ${LIBS} ${ZLIB_LIBRARIES})
|
|
110
|
+
|
|
111
|
+# Add Thread Library
|
|
112
|
+find_package (Threads REQUIRED)
|
|
113
|
+set (LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
|
114
|
+
|
|
115
|
+# Link to all found libs
|
|
116
|
+target_link_libraries (OpenRaider ${LIBS})
|