blob: d3d89e8e59df8967af943896d80f37692cd1601f (
plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
|
# Aliens vs Predator Linux - http://icculus.org/avp/
# CMake 2.8 project
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
# default to Release
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
MESSAGE(STATUS "No build type specified, defaulting to Release")
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Build type; one of: Debug Release RelWithDebInfo MinSizeRel" FORCE)
SET_PROPERTY(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
ENDIF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
# default to Desktop build
IF(NOT AVP_BUILD_TYPE)
SET(AVP_BUILD_TYPE DESKTOP CACHE STRING "Executable type; one of: DESKTOP WEB" FORCE)
ENDIF(NOT AVP_BUILD_TYPE)
IF(NOT AVP_BUILD_TYPE STREQUAL "DESKTOP" AND NOT AVP_BUILD_TYPE STREQUAL "WEB")
MESSAGE(FATAL_ERROR "Invalid AVP_BUILD_TYPE setting ${AVP_BUILD_TYPE}; must be one of DESKTOP WEB")
ENDIF(NOT AVP_BUILD_TYPE STREQUAL "DESKTOP" AND NOT AVP_BUILD_TYPE STREQUAL "WEB")
SET(AVP_WEB "NO")
IF(AVP_BUILD_TYPE STREQUAL "WEB")
SET(AVP_WEB "YES")
ENDIF(AVP_BUILD_TYPE STREQUAL "WEB")
PROJECT(avp)
IF(AVP_WEB)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -g4 -s USE_SDL=2 -s TOTAL_MEMORY=234881024 -s ASSERTIONS=2 -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -s DEMANGLE_SUPPORT=1")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -g4 -s USE_SDL=2 -s TOTAL_MEMORY=234881024 -s ASSERTIONS=2 -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -s DEMANGLE_SUPPORT=1")
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_SDL=2 -s TOTAL_MEMORY=234881024")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL=2 -s TOTAL_MEMORY=234881024")
ENDIF()
IF(AVP_WEB_WASM)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s WASM=1")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s WASM=1")
ENDIF()
ENDIF(AVP_WEB)
# required dependencies
IF(NOT AVP_WEB)
INCLUDE(FindOpenGLES2.cmake)
INCLUDE(FindSDL2.cmake)
INCLUDE(FindLibAV.cmake)
INCLUDE(FindSDL)
INCLUDE(FindOpenGL)
INCLUDE(FindOpenAL)
# Use SDL 1.2 if it is installed, else use SDL 2.0.
IF(NOT SDL_TYPE)
SET(SDL_TYPE AUTO CACHE STRING "SDL Version; one of: AUTO SDL SDL2")
SET_PROPERTY(CACHE SDL_TYPE PROPERTY STRINGS "AUTO" "SDL" "SDL2")
ENDIF(NOT SDL_TYPE)
IF(NOT SDL_TYPE STREQUAL "AUTO" AND NOT SDL_TYPE STREQUAL "SDL" AND NOT SDL_TYPE STREQUAL "SDL2")
MESSAGE(FATAL_ERROR "Invalid SDL_TYPE setting ${SDL_TYPE}; must be one of AUTO SDL SDL2")
ENDIF(NOT SDL_TYPE STREQUAL "AUTO" AND NOT SDL_TYPE STREQUAL "SDL" AND NOT SDL_TYPE STREQUAL "SDL2")
IF(SDL_FOUND)
IF(SDL_VERSION_STRING VERSION_LESS "1.2.0")
MESSAGE(WARNING "SDL 1.2 was claimed to be found with version ${SDL_VERSION_STRING}, ignoring...")
UNSET(SDL_FOUND)
ENDIF(SDL_VERSION_STRING VERSION_LESS "1.2.0")
IF(SDL_VERSION_STRING VERSION_GREATER "1.2.99")
MESSAGE(WARNING "SDL 1.2 was claimed to be found with version ${SDL_VERSION_STRING}, ignoring...")
UNSET(SDL_FOUND)
ENDIF(SDL_VERSION_STRING VERSION_GREATER "1.2.99")
ENDIF(SDL_FOUND)
IF(SDL_TYPE STREQUAL "AUTO")
IF(SDL_FOUND)
MESSAGE(STATUS "SDL 1.2 found; using that.")
SET(SDL_TYPE "SDL")
ENDIF(SDL_FOUND)
ENDIF(SDL_TYPE STREQUAL "AUTO")
IF(SDL_TYPE STREQUAL "AUTO")
IF(SDL2_FOUND)
MESSAGE(STATUS "SDL 2.0 found; using that.")
SET(SDL_TYPE "SDL2")
ENDIF(SDL2_FOUND)
ENDIF(SDL_TYPE STREQUAL "AUTO")
IF(SDL_TYPE STREQUAL "AUTO")
MESSAGE(FATAL_ERROR "SDL 1.2 or SDL 2.0 is required but CMake couldn't find it.")
ENDIF(SDL_TYPE STREQUAL "AUTO")
IF(SDL_TYPE STREQUAL "SDL")
IF(NOT SDL_FOUND)
MESSAGE(FATAL_ERROR "SDL 1.2 was requested but CMake couldn't find it.")
ENDIF(NOT SDL_FOUND)
ENDIF(SDL_TYPE STREQUAL "SDL")
IF(SDL_TYPE STREQUAL "SDL2")
IF(NOT SDL2_FOUND)
MESSAGE(FATAL_ERROR "SDL 2.0 was requested but CMake couldn't find it.")
ENDIF(NOT SDL2_FOUND)
MESSAGE(WARNING "SDL 2.0 support is EXPERIMENTAL and INCOMPLETE.")
ENDIF(SDL_TYPE STREQUAL "SDL2")
# Use Desktop OpenGL if it is available, else try OpenGL ES 2.0.
IF(NOT OPENGL_TYPE)
SET(OPENGL_TYPE AUTO CACHE STRING "OpenGL Version; one of: AUTO OPENGL OPENGLES2")
SET_PROPERTY(CACHE OPENGL_TYPE PROPERTY STRINGS "AUTO" "OPENGL" "OPENGLES2")
ENDIF(NOT OPENGL_TYPE)
IF(NOT OPENGL_TYPE STREQUAL "AUTO" AND NOT OPENGL_TYPE STREQUAL "OPENGL" AND NOT OPENGL_TYPE STREQUAL "OPENGLES2")
MESSAGE(FATAL_ERROR "Invalid OPENGL_TYPE setting ${OPENGL_TYPE}; must be one of AUTO OPENGL OPENGLES2")
ENDIF(NOT OPENGL_TYPE STREQUAL "AUTO" AND NOT OPENGL_TYPE STREQUAL "OPENGL" AND NOT OPENGL_TYPE STREQUAL "OPENGLES2")
IF(OPENGL_TYPE STREQUAL "AUTO")
IF(OPENGL_FOUND)
MESSAGE(STATUS "OpenGL found; using that.")
SET(OPENGL_TYPE "OPENGL")
ENDIF(OPENGL_FOUND)
ENDIF(OPENGL_TYPE STREQUAL "AUTO")
IF(OPENGL_TYPE STREQUAL "AUTO")
IF(OPENGLES2_FOUND)
MESSAGE(STATUS "OpenGL ES 2.0 found; using that.")
SET(OPENGL_TYPE "OPENGLES2")
ENDIF(OPENGLES2_FOUND)
ENDIF(OPENGL_TYPE STREQUAL "AUTO")
IF(OPENGL_TYPE STREQUAL "AUTO")
MESSAGE(FATAL_ERROR "OpenGL is required but CMake couldn't find it.")
ENDIF(OPENGL_TYPE STREQUAL "AUTO")
IF(OPENGL_TYPE STREQUAL "OPENGL")
IF(NOT OPENGL_FOUND)
MESAGE(FATAL_ERROR "OpenGL was requested but CMake couldn't find it.")
ENDIF(NOT OPENGL_FOUND)
ENDIF(OPENGL_TYPE STREQUAL "OPENGL")
IF(OPENGL_TYPE STREQUAL "OPENGLES2")
IF(NOT OPENGLES2_FOUND)
MESSAGE(FATAL_ERROR "OpenGL ES 2.0 was requested but CMake couldn't find it.")
ENDIF(NOT OPENGLES2_FOUND)
IF(NOT SDL_TYPE STREQUAL "SDL2")
MESSAGE(FATAL_ERROR "OpenGL ES 2.0 support requires SDL2.")
ENDIF(NOT SDL_TYPE STREQUAL "SDL2")
ENDIF(OPENGL_TYPE STREQUAL "OPENGLES2")
# OpenAL
IF(NOT OPENAL_FOUND)
MESSAGE(FATAL_ERROR "OpenAL is required but CMake couldn't find it.")
ENDIF(NOT OPENAL_FOUND)
ENDIF(NOT AVP_WEB)
# required source files
LIST(APPEND source src/bink.c)
LIST(APPEND source src/stubs.c)
LIST(APPEND source src/version.c)
LIST(APPEND source src/mathline.c)
LIST(APPEND source src/net.c)
LIST(APPEND source src/frustum.c)
LIST(APPEND source src/kshape.c)
LIST(APPEND source src/map.c)
LIST(APPEND source src/maths.c)
LIST(APPEND source src/md5.c)
LIST(APPEND source src/mem3dc.c)
LIST(APPEND source src/mem3dcpp.cpp)
LIST(APPEND source src/module.c)
LIST(APPEND source src/morph.c)
LIST(APPEND source src/object.c)
LIST(APPEND source src/shpanim.c)
LIST(APPEND source src/sphere.c)
LIST(APPEND source src/tables.c)
LIST(APPEND source src/vdb.c)
LIST(APPEND source src/avp/ai_sight.c)
LIST(APPEND source src/avp/avpview.c)
LIST(APPEND source src/avp/bh_agun.c)
LIST(APPEND source src/avp/bh_ais.c)
LIST(APPEND source src/avp/bh_alien.c)
LIST(APPEND source src/avp/bh_binsw.c)
LIST(APPEND source src/avp/bh_cable.c)
LIST(APPEND source src/avp/bh_corpse.c)
LIST(APPEND source src/avp/bh_deathvol.c)
LIST(APPEND source src/avp/bh_debri.c)
LIST(APPEND source src/avp/bh_dummy.c)
LIST(APPEND source src/avp/bh_fan.c)
LIST(APPEND source src/avp/bh_far.c)
LIST(APPEND source src/avp/bh_fhug.c)
LIST(APPEND source src/avp/bh_gener.c)
LIST(APPEND source src/avp/bh_ldoor.c)
LIST(APPEND source src/avp/bh_lift.c)
LIST(APPEND source src/avp/bh_light.c)
LIST(APPEND source src/avp/bh_lnksw.c)
LIST(APPEND source src/avp/bh_ltfx.c)
LIST(APPEND source src/avp/bh_marin.c)
LIST(APPEND source src/avp/bh_mission.c)
LIST(APPEND source src/avp/bh_near.c)
LIST(APPEND source src/avp/bh_pargen.c)
LIST(APPEND source src/avp/bh_plachier.c)
LIST(APPEND source src/avp/bh_plift.c)
LIST(APPEND source src/avp/bh_pred.c)
LIST(APPEND source src/avp/bh_queen.c)
LIST(APPEND source src/avp/bh_rubberduck.c)
LIST(APPEND source src/avp/bh_selfdest.c)
LIST(APPEND source src/avp/bh_snds.c)
LIST(APPEND source src/avp/bh_spcl.c)
LIST(APPEND source src/avp/bh_swdor.c)
LIST(APPEND source src/avp/bh_track.c)
LIST(APPEND source src/avp/bh_types.c)
LIST(APPEND source src/avp/bh_videoscreen.c)
LIST(APPEND source src/avp/bh_waypt.c)
LIST(APPEND source src/avp/bh_weap.c)
LIST(APPEND source src/avp/bh_xeno.c)
LIST(APPEND source src/avp/bonusabilities.c)
LIST(APPEND source src/avp/cconvars.cpp)
LIST(APPEND source src/avp/cdtrackselection.cpp)
LIST(APPEND source src/avp/cheatmodes.c)
LIST(APPEND source src/avp/comp_map.c)
LIST(APPEND source src/avp/comp_shp.c)
LIST(APPEND source src/avp/consolelog.cpp)
LIST(APPEND source src/avp/davehook.cpp)
LIST(APPEND source src/avp/deaths.c)
LIST(APPEND source src/avp/decal.c)
LIST(APPEND source src/avp/detaillevels.c)
LIST(APPEND source src/avp/dynamics.c)
LIST(APPEND source src/avp/dynblock.c)
LIST(APPEND source src/avp/equipmnt.c)
LIST(APPEND source src/avp/extents.c)
LIST(APPEND source src/avp/game.c)
LIST(APPEND source src/avp/game_statistics.c)
LIST(APPEND source src/avp/gamecmds.cpp)
LIST(APPEND source src/avp/gamevars.cpp)
LIST(APPEND source src/avp/hmodel.c)
LIST(APPEND source src/avp/hud.c)
LIST(APPEND source src/avp/inventry.c)
LIST(APPEND source src/avp/language.c)
LIST(APPEND source src/avp/lighting.c)
LIST(APPEND source src/avp/load_shp.c)
LIST(APPEND source src/avp/los.c)
LIST(APPEND source src/avp/mempool.c)
LIST(APPEND source src/avp/messagehistory.c)
LIST(APPEND source src/avp/missions.cpp)
LIST(APPEND source src/avp/movement.c)
LIST(APPEND source src/avp/paintball.c)
LIST(APPEND source src/avp/particle.c)
LIST(APPEND source src/avp/pfarlocs.c)
LIST(APPEND source src/avp/pheromon.c)
LIST(APPEND source src/avp/player.c)
LIST(APPEND source src/avp/pmove.c)
LIST(APPEND source src/avp/psnd.c)
LIST(APPEND source src/avp/psndproj.c)
LIST(APPEND source src/avp/pvisible.c)
LIST(APPEND source src/avp/savegame.c)
LIST(APPEND source src/avp/scream.cpp)
LIST(APPEND source src/avp/secstats.c)
LIST(APPEND source src/avp/sfx.c)
LIST(APPEND source src/avp/stratdef.c)
LIST(APPEND source src/avp/targeting.c)
LIST(APPEND source src/avp/track.c)
LIST(APPEND source src/avp/triggers.c)
LIST(APPEND source src/avp/weapons.c)
LIST(APPEND source src/avp/shapes/cube.c)
LIST(APPEND source src/avp/support/consbind.cpp)
LIST(APPEND source src/avp/support/consbtch.cpp)
LIST(APPEND source src/avp/support/coordstr.cpp)
LIST(APPEND source src/avp/support/daemon.cpp)
LIST(APPEND source src/avp/support/indexfnt.cpp)
LIST(APPEND source src/avp/support/r2base.cpp)
LIST(APPEND source src/avp/support/r2pos666.cpp)
LIST(APPEND source src/avp/support/reflist.cpp)
LIST(APPEND source src/avp/support/refobj.cpp)
LIST(APPEND source src/avp/support/rentrntq.cpp)
LIST(APPEND source src/avp/support/scstring.cpp)
LIST(APPEND source src/avp/support/strtab.cpp)
LIST(APPEND source src/avp/support/strutil.c)
LIST(APPEND source src/avp/support/trig666.cpp)
LIST(APPEND source src/avp/support/wrapstr.cpp)
LIST(APPEND source src/avp/win95/avpchunk.cpp)
LIST(APPEND source src/avp/win95/cheat.c)
LIST(APPEND source src/avp/win95/chtcodes.cpp)
LIST(APPEND source src/avp/win95/d3d_hud.cpp)
LIST(APPEND source src/avp/win95/ddplat.cpp)
LIST(APPEND source src/avp/win95/endianio.c)
LIST(APPEND source src/avp/win95/ffread.cpp)
LIST(APPEND source src/avp/win95/ffstdio.cpp)
LIST(APPEND source src/avp/win95/gammacontrol.cpp)
LIST(APPEND source src/avp/win95/hierplace.cpp)
LIST(APPEND source src/avp/win95/iofocus.cpp)
LIST(APPEND source src/avp/win95/jsndsup.cpp)
LIST(APPEND source src/avp/win95/kzsort.c)
LIST(APPEND source src/avp/win95/langplat.c)
LIST(APPEND source src/avp/win95/modcmds.cpp)
LIST(APPEND source src/avp/win95/npcsetup.cpp)
LIST(APPEND source src/avp/win95/objsetup.cpp)
LIST(APPEND source src/avp/win95/pathchnk.cpp)
LIST(APPEND source src/avp/win95/platsup.c)
LIST(APPEND source src/avp/win95/pldghost.c)
LIST(APPEND source src/avp/win95/pldnet.c)
LIST(APPEND source src/avp/win95/progress_bar.cpp)
LIST(APPEND source src/avp/win95/projload.cpp)
LIST(APPEND source src/avp/win95/scrshot.cpp)
LIST(APPEND source src/avp/win95/strachnk.cpp)
LIST(APPEND source src/avp/win95/system.c)
LIST(APPEND source src/avp/win95/usr_io.c)
LIST(APPEND source src/avp/win95/vision.c)
LIST(APPEND source src/avp/win95/frontend/avp_envinfo.c)
LIST(APPEND source src/avp/win95/frontend/avp_intro.cpp)
LIST(APPEND source src/avp/win95/frontend/avp_menudata.c)
LIST(APPEND source src/avp/win95/frontend/avp_menus.c)
LIST(APPEND source src/avp/win95/frontend/avp_mp_config.cpp)
LIST(APPEND source src/avp/win95/frontend/avp_userprofile.cpp)
LIST(APPEND source src/avp/win95/gadgets/ahudgadg.cpp)
LIST(APPEND source src/avp/win95/gadgets/conscmnd.cpp)
LIST(APPEND source src/avp/win95/gadgets/conssym.cpp)
LIST(APPEND source src/avp/win95/gadgets/consvar.cpp)
LIST(APPEND source src/avp/win95/gadgets/gadget.cpp)
LIST(APPEND source src/avp/win95/gadgets/hudgadg.cpp)
LIST(APPEND source src/avp/win95/gadgets/rootgadg.cpp)
LIST(APPEND source src/avp/win95/gadgets/t_ingadg.cpp)
LIST(APPEND source src/avp/win95/gadgets/teletype.cpp)
LIST(APPEND source src/avp/win95/gadgets/textexp.cpp)
LIST(APPEND source src/avp/win95/gadgets/textin.cpp)
LIST(APPEND source src/avp/win95/gadgets/trepgadg.cpp)
LIST(APPEND source src/win95/animchnk.cpp)
LIST(APPEND source src/win95/animobs.cpp)
LIST(APPEND source src/win95/awtexld.cpp)
LIST(APPEND source src/win95/awbmpld.cpp)
LIST(APPEND source src/win95/awiffld.cpp)
LIST(APPEND source src/win95/awpnmld.cpp)
LIST(APPEND source src/win95/bmpnames.cpp)
LIST(APPEND source src/win95/chnkload.cpp)
LIST(APPEND source src/win95/chnktexi.cpp)
LIST(APPEND source src/win95/chnktype.cpp)
LIST(APPEND source src/win95/chunk.cpp)
LIST(APPEND source src/win95/chunkpal.cpp)
LIST(APPEND source src/win95/db.c)
LIST(APPEND source src/win95/debuglog.cpp)
LIST(APPEND source src/win95/dummyobjectchunk.cpp)
LIST(APPEND source src/win95/enumchnk.cpp)
LIST(APPEND source src/win95/enumsch.cpp)
LIST(APPEND source src/win95/envchunk.cpp)
LIST(APPEND source src/win95/fail.c)
LIST(APPEND source src/win95/fragchnk.cpp)
LIST(APPEND source src/win95/gsprchnk.cpp)
LIST(APPEND source src/win95/hierchnk.cpp)
LIST(APPEND source src/win95/huffman.cpp)
LIST(APPEND source src/win95/iff.cpp)
LIST(APPEND source src/win95/iff_ilbm.cpp)
LIST(APPEND source src/win95/ilbm_ext.cpp)
LIST(APPEND source src/win95/io.c)
LIST(APPEND source src/win95/list_tem.cpp)
LIST(APPEND source src/win95/ltchunk.cpp)
LIST(APPEND source src/win95/media.cpp)
LIST(APPEND source src/win95/mishchnk.cpp)
LIST(APPEND source src/win95/obchunk.cpp)
LIST(APPEND source src/win95/oechunk.cpp)
LIST(APPEND source src/win95/our_mem.c)
LIST(APPEND source src/win95/plat_shp.c)
LIST(APPEND source src/win95/plspecfn.c)
LIST(APPEND source src/win95/shpchunk.cpp)
LIST(APPEND source src/win95/sndchunk.cpp)
LIST(APPEND source src/win95/sprchunk.cpp)
LIST(APPEND source src/win95/string.cpp)
LIST(APPEND source src/win95/texio.c)
LIST(APPEND source src/win95/toolchnk.cpp)
LIST(APPEND source src/win95/txioctrl.cpp)
LIST(APPEND source src/win95/wpchunk.cpp)
LIST(APPEND source src/win95/zsp.cpp)
LIST(APPEND source src/opengl.c)
LIST(APPEND source src/oglfunc.c)
LIST(APPEND source src/fmv.c)
LIST(APPEND source src/openal.c)
LIST(APPEND source src/cdplayer.c)
LIST(APPEND source src/menus.c)
IF(WIN32)
LIST(APPEND source src/winfiles.c)
ELSE(WIN32)
LIST(APPEND source src/files.c)
LIST(APPEND source src/winapi.c)
ENDIF(WIN32)
IF(AVP_WEB)
LIST(APPEND source src/main2.c)
ENDIF(AVP_WEB)
IF(NOT AVP_WEB)
IF(SDL_TYPE STREQUAL "SDL")
LIST(APPEND source src/main.c)
# SDL 1.2 on OS X requires this support file
IF(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
LIST(APPEND source src/sdl12/sdlmain.m)
ENDIF(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
ENDIF(SDL_TYPE STREQUAL "SDL")
IF(SDL_TYPE STREQUAL "SDL2")
LIST(APPEND source src/main2.c)
ENDIF(SDL_TYPE STREQUAL "SDL2")
ENDIF(NOT AVP_WEB)
### build all source as C++
### (not normally used)
##SET_SOURCE_FILES_PROPERTIES(${source} PROPERTIES LANGUAGE CXX)
# auto-include directories with source files
FOREACH(sourcefile IN LISTS source)
GET_FILENAME_COMPONENT(includedir ${sourcefile} PATH) # newer CMake uses DIRECTORY
LIST(APPEND include ${includedir})
ENDFOREACH(sourcefile)
INCLUDE_DIRECTORIES(${include})
# manually include src/include
INCLUDE_DIRECTORIES(src/include)
IF(AVP_WEB)
ADD_DEFINITIONS(-DUSE_OPENGL_ES=1)
ADD_EXECUTABLE(avp ${source})
ENDIF(AVP_WEB)
IF(NOT AVP_WEB)
ADD_EXECUTABLE(avp ${source})
INSTALL(TARGETS avp DESTINATION bin)
# required dependencies
IF(WIN32)
TARGET_LINK_LIBRARIES(avp winmm)
ENDIF(WIN32)
IF(SDL_TYPE STREQUAL "SDL")
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
ENDIF(SDL_TYPE STREQUAL "SDL")
IF(SDL_TYPE STREQUAL "SDL2")
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
ENDIF(SDL_TYPE STREQUAL "SDL2")
IF(OPENGL_TYPE STREQUAL "OPENGL")
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
ENDIF(OPENGL_TYPE STREQUAL "OPENGL")
IF(OPENGL_TYPE STREQUAL "OPENGLES2")
ADD_DEFINITIONS(-DUSE_OPENGL_ES=1)
INCLUDE_DIRECTORIES(${OPENGLES2_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${EGL_INCLUDE_DIR})
ENDIF(OPENGL_TYPE STREQUAL "OPENGLES2")
INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
IF(SDL_TYPE STREQUAL "SDL")
TARGET_LINK_LIBRARIES(avp ${SDL_LIBRARY})
ENDIF(SDL_TYPE STREQUAL "SDL")
IF(SDL_TYPE STREQUAL "SDL2")
TARGET_LINK_LIBRARIES(avp ${SDL2_LIBRARY})
ENDIF(SDL_TYPE STREQUAL "SDL2")
IF(OPENGL_TYPE STREQUAL "OPENGL")
TARGET_LINK_LIBRARIES(avp ${OPENGL_gl_LIBRARY})
ENDIF(OPENGL_TYPE STREQUAL "OPENGL")
IF(OPENGL_TYPE STREQUAL "OPENGLES2")
TARGET_LINK_LIBRARIES(avp ${OPENGLES2_gl_LIBRARY})
TARGET_LINK_LIBRARIES(avp ${EGL_LIBRARIES})
ENDIF(OPENGL_TYPE STREQUAL "OPENGLES2")
TARGET_LINK_LIBRARIES(avp ${OPENAL_LIBRARY})
TARGET_LINK_LIBRARIES(avp ${LIBAV_LIBRARIES})
TARGET_LINK_LIBRARIES(avp ${SWSCALE_LIBRARIES})
TARGET_LINK_LIBRARIES(avp ${AVCODEC_LIBRARIES})
ENDIF(NOT AVP_WEB)
|