Added
Link Here
|
1 |
--- CMakeLists.txt.orig 2018-04-23 17:26:25 UTC |
2 |
+++ CMakeLists.txt |
3 |
@@ -6,6 +6,7 @@ set(CMAKE_CXX_STANDARD 14) |
4 |
|
5 |
|
6 |
option (REGOTH_BUILD_WITH_INSTALLER_EXTRACTOR "Compile with library to extract some installers of Gothic" OFF) |
7 |
+option (REGOTH_BUILD_WITH_SYSTEM_OPENAL "Compile with system OpenAL" OFF) |
8 |
|
9 |
|
10 |
# Vim - You Complete Me |
11 |
@@ -174,6 +175,9 @@ include_directories(lib/bullet3/src) |
12 |
set(BULLET_LIBRARIES BulletSoftBody BulletDynamics BulletCollision LinearMath) |
13 |
set(BULLET_MISC Bullet3Dynamics Bullet2FileLoader Bullet3Collision Bullet3Geometry Bullet3OpenCL_clew BulletFileLoader BulletWorldImporter BulletXmlWorldImporter ConvexDecomposition GIMPACTUtils HACD Test_BulletDynamics Test_BulletInverseDynamics Test_Collision) |
14 |
|
15 |
+# Find OpenGL |
16 |
+find_package(OpenGL REQUIRED) |
17 |
+include_directories(${OPENGL_INCLUDE_DIR}) # required by glfw headers |
18 |
|
19 |
# ------------------ Engine lib ------------------ |
20 |
file(GLOB ENGINE_SRC |
21 |
@@ -223,54 +227,64 @@ endif() |
22 |
# ------------------ OpenAL ------------------ |
23 |
|
24 |
# Set up OpenAL |
25 |
+if(REGOTH_BUILD_WITH_SYSTEM_OPENAL AND NOT EMSCRIPTEN) |
26 |
+ find_package(OpenAL REQUIRED) |
27 |
+ include_directories(${OPENAL_INCLUDE_DIR}) |
28 |
|
29 |
-set(ALSOFT_CONFIG OFF CACHE BOOL "" FORCE) |
30 |
-set(ALSOFT_EXAMPLES OFF CACHE BOOL "" FORCE) |
31 |
-set(ALSOFT_INSTALL OFF CACHE BOOL "" FORCE) |
32 |
- |
33 |
-if (UNIX) |
34 |
- set(LIBTYPE STATIC CACHE STRING "" FORCE) |
35 |
- if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
36 |
- set(ALSOFT_REQUIRE_ALSA ON CACHE BOOL "" FORCE) |
37 |
- set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
38 |
- elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") |
39 |
- set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
40 |
- set(ALSOFT_BACKEND_OSS ON CACHE BOOL "" FORCE) |
41 |
- set(ALSOFT_BACKEND_SNDIO OFF CACHE BOOL "" FORCE) |
42 |
- set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
43 |
- elseif(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") |
44 |
- set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
45 |
- set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
46 |
- set(ALSOFT_BACKEND_SNDIO ON CACHE BOOL "" FORCE) |
47 |
- set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
48 |
+ if (UNIX) |
49 |
+ target_link_libraries(engine ${OPENAL_LIBRARY}) |
50 |
+ elseif(WIN32) |
51 |
+ target_link_libraries(engine common ${OPENAL_LIBRARY}) |
52 |
endif() |
53 |
else() |
54 |
- set(LIBTYPE SHARED CACHE STRING "" FORCE) |
55 |
-endif() |
56 |
+ set(ALSOFT_CONFIG OFF CACHE BOOL "" FORCE) |
57 |
+ set(ALSOFT_EXAMPLES OFF CACHE BOOL "" FORCE) |
58 |
+ set(ALSOFT_INSTALL OFF CACHE BOOL "" FORCE) |
59 |
|
60 |
-if(NOT EMSCRIPTEN) |
61 |
- add_subdirectory(${CMAKE_SOURCE_DIR}/lib/openal-soft) |
62 |
- include_directories(${CMAKE_SOURCE_DIR}/lib/openal-soft/include) |
63 |
- |
64 |
if (UNIX) |
65 |
+ set(LIBTYPE STATIC CACHE STRING "" FORCE) |
66 |
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
67 |
- set(ALSOFT_REQUIRE_ALSA ON CACHE BOOL "" FORCE) |
68 |
- set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
69 |
+ set(ALSOFT_REQUIRE_ALSA ON CACHE BOOL "" FORCE) |
70 |
+ set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
71 |
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") |
72 |
- set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
73 |
- set(ALSOFT_BACKEND_OSS ON CACHE BOOL "" FORCE) |
74 |
- set(ALSOFT_BACKEND_SNDIO OFF CACHE BOOL "" FORCE) |
75 |
- set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
76 |
+ set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
77 |
+ set(ALSOFT_BACKEND_OSS ON CACHE BOOL "" FORCE) |
78 |
+ set(ALSOFT_BACKEND_SNDIO OFF CACHE BOOL "" FORCE) |
79 |
+ set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
80 |
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") |
81 |
- set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
82 |
- set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
83 |
- set(ALSOFT_BACKEND_SNDIO ON CACHE BOOL "" FORCE) |
84 |
- set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
85 |
+ set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
86 |
+ set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
87 |
+ set(ALSOFT_BACKEND_SNDIO ON CACHE BOOL "" FORCE) |
88 |
+ set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
89 |
endif() |
90 |
- target_link_libraries(engine OpenAL) |
91 |
- elseif(WIN32) |
92 |
- target_link_libraries(engine common OpenAL) |
93 |
+ else() |
94 |
+ set(LIBTYPE SHARED CACHE STRING "" FORCE) |
95 |
endif() |
96 |
+ |
97 |
+ if(NOT EMSCRIPTEN) |
98 |
+ add_subdirectory(${CMAKE_SOURCE_DIR}/lib/openal-soft) |
99 |
+ include_directories(${CMAKE_SOURCE_DIR}/lib/openal-soft/include) |
100 |
+ |
101 |
+ if (UNIX) |
102 |
+ if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
103 |
+ set(ALSOFT_REQUIRE_ALSA ON CACHE BOOL "" FORCE) |
104 |
+ set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
105 |
+ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") |
106 |
+ set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
107 |
+ set(ALSOFT_BACKEND_OSS ON CACHE BOOL "" FORCE) |
108 |
+ set(ALSOFT_BACKEND_SNDIO OFF CACHE BOOL "" FORCE) |
109 |
+ set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
110 |
+ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") |
111 |
+ set(ALSOFT_REQUIRE_ALSA OFF CACHE BOOL "" FORCE) |
112 |
+ set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "" FORCE) |
113 |
+ set(ALSOFT_BACKEND_SNDIO ON CACHE BOOL "" FORCE) |
114 |
+ set(ALSOFT_BACKEND_SOLARIS OFF CACHE BOOL "" FORCE) |
115 |
+ endif() |
116 |
+ target_link_libraries(engine OpenAL) |
117 |
+ elseif(WIN32) |
118 |
+ target_link_libraries(engine common OpenAL) |
119 |
+ endif() |
120 |
+ endif() |
121 |
endif() |
122 |
|
123 |
# ---------------- libdmusic ---------------- |
124 |
@@ -310,6 +324,10 @@ if(NOT ANDROID) |
125 |
else() |
126 |
add_definitions(-DRE_USE_SOUND) |
127 |
target_link_libraries(engine android_glue) |
128 |
+endif() |
129 |
+ |
130 |
+if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") |
131 |
+ include_directories("lib/bgfx-cmake/bx/include/compat/freebsd") |
132 |
endif() |
133 |
|
134 |
add_subdirectory(lib/adpcm) |