2 set(VSHADPP_DEFINES -DGL4ES_HACKS)
5 function(sxx_compile output filename)
6 get_filename_component(ext ${filename} EXT)
7 if(NOT ext STREQUAL ".sxx")
10 get_filename_component(base ${filename} NAME_WE)
11 set(base_abs ${CMAKE_CURRENT_BINARY_DIR}/${base})
12 set(outfiles ${base_abs}.ci ${base_abs}.hi)
13 set(${output} ${${output}} ${outfiles} PARENT_SCOPE)
14 #message("outfiles=${outfiles}, DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
15 if(CMAKE_CROSSCOMPILING AND NOT WIN32)
16 file(GLOB vshadpp_FILES CONFIGURE_DEPENDS
17 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/*.vs
18 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/*.fs
19 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/common/*.vs
20 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/common/*.fs
21 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/common/*.inc
22 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/decal/*.fs
23 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/decal/*.vs
24 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/draw/*.fs
25 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/draw/*.vs
26 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/lightmap/*.fs
27 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/lightmap/*.vs
28 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/*.fs
29 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/*.vs
30 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/poly/*.fs
31 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/poly/*.vs
32 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/particle/*.fs
33 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/particle/*.vs
34 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/*.fs
35 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/*.vs
36 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/model/*.fs
37 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/model/*.vs
38 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/surf/*.fs
39 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/surf/*.vs
40 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/sky/*.fs
41 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/sky/*.vs
42 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/wipe/*.fs
43 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/wipe/*.vs
44 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/bloom/*.fs
45 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/bloom/*.vs
46 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/cas/*.fs
47 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/cas/*.vs
48 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colorblind/*.fs
49 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colorblind/*.vs
50 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colormatrix/*.fs
51 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colormatrix/*.vs
52 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/overbright/*.fs
53 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/overbright/*.vs
54 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/tonemap/*.fs
55 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/tonemap/*.vs
56 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/underwater/*.fs
57 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/underwater/*.vs
59 # assume we have vshadpp in PATH
62 COMMAND vshadpp ${VSHADPP_DEFINES} -o ${CMAKE_CURRENT_BINARY_DIR} -b ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
63 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
65 #${CMAKE_CURRENT_SOURCE_DIR}/${mastername}
68 file(GLOB vshadpp_FILES CONFIGURE_DEPENDS
69 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/*.vs
70 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/*.fs
71 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/common/*.vs
72 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/common/*.fs
73 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/common/*.inc
74 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/decal/*.fs
75 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/decal/*.vs
76 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/draw/*.fs
77 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/draw/*.vs
78 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/lightmap/*.fs
79 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/lightmap/*.vs
80 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/*.fs
81 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/*.vs
82 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/poly/*.fs
83 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/masked/poly/*.vs
84 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/particle/*.fs
85 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/particle/*.vs
86 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/*.fs
87 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/*.vs
88 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/model/*.fs
89 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/model/*.vs
90 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/surf/*.fs
91 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/shadowvol/surf/*.vs
92 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/sky/*.fs
93 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/sky/*.vs
94 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/wipe/*.fs
95 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/wipe/*.vs
96 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/bloom/*.fs
97 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/bloom/*.vs
98 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/cas/*.fs
99 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/cas/*.vs
100 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colorblind/*.fs
101 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colorblind/*.vs
102 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colormatrix/*.fs
103 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/colormatrix/*.vs
104 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/overbright/*.fs
105 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/overbright/*.vs
106 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/tonemap/*.fs
107 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/tonemap/*.vs
108 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/underwater/*.fs
109 ${CMAKE_SOURCE_DIR}/basev/common/glshaders/postprocess/underwater/*.vs
114 COMMAND ${WINERUN} $<TARGET_FILE:vshadpp> ${VSHADPP_DEFINES} -o ${CMAKE_CURRENT_BINARY_DIR} -b ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
115 DEPENDS vshadpp ${CMAKE_CURRENT_SOURCE_DIR}/${filename}
117 #${CMAKE_CURRENT_SOURCE_DIR}/${mastername}
120 set_source_files_properties(${outfiles} PROPERTIES GENERATED TRUE)
124 if(CMAKE_BUILD_TYPE MATCHES "Debug")
125 add_definitions(-DVAVOOM_DEBUG_BUILD=1)
130 #---------------------------------------
132 # Texture loader and manager sources
134 #---------------------------------------
135 set(TEXTURELIB_SOURCES
137 textures/r_tex_public.h
140 textures/r_tex_id.cpp
141 textures/r_tex_animdef.cpp
142 textures/r_tex_base.cpp
143 textures/r_tex_camera.cpp
144 textures/r_tex_warp.cpp
145 textures/r_tex_translation.cpp
146 textures/r_tex_atlas.cpp
148 textures/formats/img_automap.cpp
149 textures/formats/img_flat.cpp
150 textures/formats/img_imgz.cpp
151 textures/formats/img_jpeg.cpp
152 textures/formats/img_multipatch.cpp
153 textures/formats/img_patch.cpp
154 textures/formats/img_pcx.cpp
155 textures/formats/img_png.cpp
156 textures/formats/img_raw.cpp
157 textures/formats/img_tga.cpp
160 set(RENDERBASE_SOURCES
170 render/r_light_reg.cpp
171 render/r_light_reg_check.cpp
172 render/r_light_adv.cpp
173 render/r_light_adv_collect.cpp
174 render/r_light_adv_cvars.cpp
175 render/r_light_adv_fltopt.cpp
177 render/r_main_base.cpp
178 render/r_main_decals.cpp
179 render/r_main_reg.cpp
180 render/r_main_adv.cpp
181 render/r_model_parse.cpp
182 render/r_model_gz.cpp
183 render/r_model_render.cpp
184 render/modelparse/md2_normals.h
185 render/modelparse/voxelib.cpp
186 render/modelparse/r_parsecommon.cpp
187 render/modelparse/r_parse_md2.cpp
188 render/modelparse/r_parse_md3.cpp
189 render/modelparse/r_parse_kvx.cpp
190 render/r_particle.cpp
193 render/r_surf_1sided.cpp
194 render/r_surf_2sextra.cpp
195 render/r_surf_2sided.cpp
196 render/r_surf_2sided_pobj.cpp
197 render/r_surf_axes_texture.cpp
198 render/r_surf_common.cpp
199 render/r_surf_flat.cpp
200 render/r_surf_lmap_io.cpp
201 render/r_surf_mgmt.cpp
202 render/r_surf_opening.cpp
203 render/r_surf_post_adv.cpp
204 render/r_surf_post_reg.cpp
205 render/r_surf_tjunk.cpp
206 render/r_surf_update.cpp
207 render/r_surf_update_fake.cpp
208 render/r_utils_openings.cpp
209 render/r_maskqueue.cpp
210 render/r_psprites.cpp
212 render/r_things_adv.cpp
214 render/r_vis_flood.cpp
216 render/r_vis_light.cpp
219 #---------------------------------------
221 # sound subsystem sources
223 #---------------------------------------
232 sound/utils/snd_midisong.cpp
233 sound/utils/snd_qmus2mid.cpp
234 sound/utils/snd_sf2scan.cpp
235 #k8:not used, 'cause there is no EAX/EFX support: sound/utils/snd_reverbs.cpp
237 sound/snd_streamplayer.cpp
239 sound/nukedopl/opl3.c
240 sound/nukedopl/musmid.cpp
242 sound/decoders/snd_timidity.cpp
243 sound/decoders/snd_wav.cpp
244 sound/decoders/snd_xmplite.cpp
245 sound/decoders/snd_nuked.cpp
249 set(SOUNDSYS_SOURCES ${SOUNDSYS_SOURCES} sound/mojoal/mojoal.c)
253 #---------------------------------------
255 # network subsystem sources
257 #---------------------------------------
261 net/net_channel_control.cpp
262 net/net_channel_level.cpp
263 net/net_channel_object_map.cpp
264 net/net_channel_player.cpp
265 net/net_channel_thinker.cpp
266 net/net_connection.cpp
275 net/net_object_map.cpp
280 #---------------------------------------
284 #---------------------------------------
286 bsp/ajbsp/bsp_level.cpp
287 bsp/ajbsp/bsp_node.cpp
288 bsp/ajbsp/bsp_util.cpp
293 #---------------------------------------
297 #---------------------------------------
299 bsp/zdbsp/nodebuild.cpp
300 bsp/zdbsp/nodebuild_events.cpp
301 bsp/zdbsp/nodebuild_extract.cpp
302 bsp/zdbsp/nodebuild_gl.cpp
303 bsp/zdbsp/nodebuild_utility.cpp
304 bsp/zdbsp/nodebuild_classify_nosse2.cpp
305 bsp/zdbsp/zdbsp_extr.cpp
309 #---------------------------------------
311 # file subsystem sources
313 #---------------------------------------
320 set(VLEVEL_CLASS_SOURCES
323 level/level_3dcoldet.cpp
324 level/level_3dfloors.cpp
325 level/level_3dpobj_coldet.cpp
326 level/level_calclineseg.cpp
327 level/level_dbgexport.cpp
328 level/level_decals.cpp
329 level/level_decals_spread_flat.cpp
330 level/level_decals_spread_wall.cpp
331 level/level_decals_bootcheck.cpp
332 level/level_light.cpp
333 level/level_miscapi.cpp
334 level/level_nodebbox.cpp
335 level/level_opening.cpp
336 level/level_saveio.cpp
337 level/level_secnode.cpp
338 level/level_sector_change.cpp
339 level/level_soundprop.cpp
340 level/level_think.cpp
353 set(MAPLOADER_SOURCES
354 maploader/mapload.cpp
355 maploader/mapload_cacheio.cpp
356 maploader/mapload_udmf.cpp
357 maploader/loader/lines.cpp
358 maploader/loader/sectors.cpp
359 maploader/loader/verts.cpp
360 maploader/loader/sides.cpp
361 maploader/loader/reject.cpp
362 maploader/loader/things.cpp
363 maploader/loader/acs.cpp
364 maploader/mapload_calc.cpp
365 maploader/mapload_decals.cpp
366 maploader/mapload_nodes_aj.cpp
367 maploader/mapload_nodes_zd.cpp
368 maploader/mapload_fixers.cpp
369 maploader/mapload_postload.cpp
370 maploader/mapload_blockmap.cpp
381 psim/p_decal_private.h
385 psim/p_entity_misc.cpp
386 psim/p_entity_sight.cpp
387 #psim/p_entity_world.cpp
388 psim/p_entity_checkpos.cpp
389 psim/p_entity_checkrelpos.cpp
390 psim/p_entity_worldlink.cpp
391 psim/p_entity_worldtrymove.cpp
392 psim/p_entity_worldslide.cpp
393 psim/p_entity_worldbounce.cpp
396 psim/p_gameobject.cpp
402 psim/p_player_input.cpp
403 psim/p_playerreplicationinfo.cpp
404 psim/p_playerreplicationinfo.h
405 psim/p_polyobj_misc.cpp
406 psim/p_polyobj_movement.cpp
407 psim/p_polyobj_spawn.cpp
408 psim/p_polyobj_vcapi.cpp
414 #psim/p_trace_sight.cpp
415 #psim/p_trace_light.cpp
416 psim/p_trace_sightlight.cpp
424 #---------------------------------------
426 # VavoomC compiler support sources
428 #---------------------------------------
430 decorate/vc_decorate.h
431 decorate/vc_decorate.cpp
432 dehacked/vc_dehacked.h
433 dehacked/vc_dehacked.cpp
439 #---------------------------------------
441 # Main executable sources
443 #---------------------------------------
444 #file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/gitversion.h)
445 #file(TOUCH ${CMAKE_CURRENT_SOURCE_DIR}/gitversion.h.in)
450 ### ### if(FOSSIL_REPO_PATH)
451 ### ### execute_process(
452 ### ### COMMAND fossil time -R "${FOSSIL_REPO_PATH}" -n 1 -F "%H" -t ci
453 ### ### COMMAND head -c 16
454 ### ### DEPENDS host.cpp
455 ### ### RESULT_VARIABLE
456 ### ### FOSSIL_HASH_RESULT
457 ### ### OUTPUT_VARIABLE
460 ### ### message(STATUS "Fossil commit hash: " ${FOSSIL_HASH})
461 ### ### add_definitions("-DFOSSL_COMMIT_HASH=${FOSSIL_HASH}")
462 ### ### endif(FOSSIL_REPO_PATH)
466 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fossilversion.h
467 COMMAND sh ${CMAKE_SOURCE_DIR}/utils/getfossver.sh "${FOSSIL_REPO_PATH}" ${CMAKE_CURRENT_BINARY_DIR}/fossilversion.h
470 add_definitions("-DHAVE_FOSSIL_COMMIT_HASH")
471 set(SRC_FOSSVER "${CMAKE_CURRENT_BINARY_DIR}/fossilversion.h")
472 else(FOSSIL_REPO_PATH)
474 endif(FOSSIL_REPO_PATH)
476 #---------------------------------------
478 # Sources shared between cliend and server
480 #---------------------------------------
481 set(CS_SHARED_SOURCES
492 # yeah, the server needs this
513 utils/ntvalueioex.cpp
519 ${VLEVEL_CLASS_SOURCES}
524 # yeah, server loads textures too
525 ${TEXTURELIB_SOURCES}
536 #-- source files for combined client/server --
538 #${CMAKE_CURRENT_BINARY_DIR}/gitversion.h
539 #${CMAKE_CURRENT_BINARY_DIR}/fossilversion.h
543 ${RENDERBASE_SOURCES}
556 widgets/ui_widget.cpp
584 #-- Common OpenGL files --
585 set(MAIN_OPENGL_SOURCES
586 render/hwgl/gl_local.h
587 render/hwgl/gl_bloom.cpp
588 render/hwgl/gl_decal.cpp
589 render/hwgl/gl_draw.cpp
590 render/hwgl/gl_main.cpp
591 render/hwgl/gl_main_ctl.cpp
592 render/hwgl/gl_main_cubemap.cpp
593 render/hwgl/gl_main_fbo.cpp
594 render/hwgl/gl_main_postprocess.cpp
595 render/hwgl/gl_main_scissor.cpp
596 render/hwgl/gl_main_shader.cpp
597 render/hwgl/gl_main_views.cpp
598 render/hwgl/gl_main_wipe.cpp
599 render/hwgl/gl_masked.cpp
600 render/hwgl/gl_model.cpp
601 render/hwgl/gl_particle.cpp
602 render/hwgl/gl_poly.cpp
604 render/hwgl/gl_poly_adv_render.h
605 render/hwgl/gl_poly_adv.cpp
606 render/hwgl/gl_poly_adv_render_ambient.cpp
607 render/hwgl/gl_poly_adv_render_fog.cpp
608 render/hwgl/gl_poly_adv_render_light.cpp
609 render/hwgl/gl_poly_adv_render_pre.cpp
610 render/hwgl/gl_poly_adv_render_smap.cpp
611 render/hwgl/gl_poly_adv_render_svol.cpp
612 render/hwgl/gl_poly_adv_render_textures.cpp
613 render/hwgl/gl_poly_adv_shadowopt.cpp
614 render/hwgl/gl_poly_adv_zpass.cpp
615 # end of advanced renderer
616 render/hwgl/gl_portal.cpp
617 render/hwgl/gl_tex.cpp
618 render/hwgl/gl_shaddef.sxx
619 ${CMAKE_CURRENT_BINARY_DIR}/gl_shaddef.hi
620 ${CMAKE_CURRENT_BINARY_DIR}/gl_shaddef.ci
623 include_directories(${CMAKE_CURRENT_BINARY_DIR})
624 foreach(file ${MAIN_OPENGL_SOURCES})
625 sxx_compile(OPENGL_GENERATED_SOURCES ${file})
628 source_group("" FILES ${MAIN_OPENGL_SOURCES})
629 #source_group(generated FILES ${OPENGL_GENERATED_SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/gitversion.h)
631 source_group(generated FILES ${OPENGL_GENERATED_SOURCES} ${SRC_FOSSVER})
632 endif(FOSSIL_REPO_PATH)
634 #add_executable(vshadpp ${MAIN_OPENGL_SOURCES} ${OPENGL_GENERATED_SOURCES})
635 #sxx_compile(render/hwgl/gl_shaddef.sxx render/hwgl/gl_main.cpp)
638 include_directories( .
641 ${SYSTEM_SOURCES_DIR}
644 #---------------------------------------
646 # Dedicated server sources
648 #---------------------------------------
649 set(SERVER_COMMON_SOURCES
650 #${CMAKE_CURRENT_BINARY_DIR}/gitversion.h
651 #${CMAKE_CURRENT_BINARY_DIR}/fossilversion.h
655 # for loading various definitions
659 # for loading various definitions
664 #---------------------------------------
668 #---------------------------------------
670 ### add_custom_target( revision_check ALL
671 ### COMMAND updaterevision ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/svnrev.h
672 ### WORKING_DIRECTORY ${UPDATEREVISION_EXE}
673 ### DEPENDS updaterevision )
675 include_directories(${CMAKE_CURRENT_BINARY_DIR})
679 if("$ENV{K8VAVOOMDEV}" STREQUAL "tan")
682 if("$ENV{USER}" STREQUAL "ketmar")
687 add_definitions(-DVAVOOM_K8_DEVELOPER)
692 #---------------------------------------
696 #---------------------------------------
698 set(MAIN_SOURCES ${COMBINED_SOURCES})
699 #set(MAIN_LIBS glbsp libglvis timidity vavoomc core ${VAVOOM_MAIN_DEPS} ${NET_LIBRARIES} ${MAIN_LIBS})
700 set(MAIN_LIBS timidity vavoomc core ${VAVOOM_MAIN_DEPS} ${NET_LIBRARIES} ${MAIN_LIBS})
701 set(MAIN_COMPILE_FLAGS "")
704 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_vorbis.cpp)
706 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_vorbis_stb.cpp)
709 #k8: we have internal opus library
710 if(OPUS_FOUND OR OPUS_USE_INTERNAL)
711 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_opus.cpp)
712 endif(OPUS_FOUND OR OPUS_USE_INTERNAL)
715 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_mp3_mad.cpp)
717 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_mp3_dr.cpp)
721 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_flac.cpp)
723 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_flac_dr.cpp)
727 set(MAIN_SOURCES ${MAIN_SOURCES} sound/decoders/snd_fluid.cpp)
733 # CMake doesn't support automatic building of resource files so
734 # we must add a custom command and add object files to the list
736 set(RC_SRC ${CMAKE_SOURCE_DIR}/branding/shitdoze.rc)
737 set(RC_OBJ ${CMAKE_CURRENT_BINARY_DIR}/shitdoze.o)
738 add_custom_command(OUTPUT ${RC_OBJ}
740 COMMAND windres -o ${RC_OBJ} -i ${RC_SRC} ${RES_FLAGS}
742 set(MAIN_SOURCES ${MAIN_SOURCES} ${RC_OBJ})
748 set(MAIN_LIBS gdi32 ole32 winmm imm32 version ${MAIN_LIBS})
750 set(MAIN_SOURCES ${MAIN_SOURCES} in_sdl.cpp sys_sdl.cpp)
751 set(MAIN_SOURCES ${MAIN_SOURCES} render/hwgl/gl_sdl.cpp render/hwgl/gl_dpi.cpp)
752 ###set(VAVOOM_MAIN_DEPS ${VAVOOM_MAIN_DEPS} imago)
753 ###set(MAIN_LIBS imago ${MAIN_LIBS})
758 ### set(MAIN_SOURCES ${MAIN_SOURCES} ${MAIN_OPENGL_SOURCES})
760 ### set(MAIN_SOURCES ${MAIN_SOURCES} winshit/render/hwgl/gl_win32.cpp)
761 ### set(MAIN_LIBS opengl32 ${MAIN_LIBS})
763 ### set(MAIN_SOURCES ${MAIN_SOURCES} render/hwgl/gl_sdl.cpp)
765 ### endif(OPENGL_FOUND)
767 set(MAIN_SOURCES ${MAIN_SOURCES} ${MAIN_OPENGL_SOURCES})
772 # prune --out-implib from executables: it doesn't make sense, even with --export-all-symbols
773 string(REGEX REPLACE "-Wl,--out-implib,[^ ]+ " " " CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE}")
774 string(REGEX REPLACE "-Wl,--out-implib,[^ ]+ " " " CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}")
778 add_library(k8vavoom SHARED ${MAIN_SOURCES})
780 add_executable(k8vavoom ${MAIN_SOURCES})
782 set_target_properties(k8vavoom PROPERTIES OUTPUT_NAME ../k8vavoom.bin)
783 else(ENABLE_WRAPPERS)
784 set_target_properties(k8vavoom PROPERTIES OUTPUT_NAME ../k8vavoom)
785 endif(ENABLE_WRAPPERS)
787 if (MAIN_COMPILE_FLAGS)
788 set_target_properties(k8vavoom PROPERTIES COMPILE_FLAGS ${MAIN_COMPILE_FLAGS})
789 endif (MAIN_COMPILE_FLAGS)
790 #message(STATUS "MAIN LINKLIBS: " ${MAIN_LIBS})
791 target_link_libraries(k8vavoom ${MAIN_LIBS})
792 #add_dependencies(k8vavoom core vavoomc timidity glbsp libglvis ${VAVOOM_MAIN_DEPS})
793 add_dependencies(k8vavoom core vavoomc timidity ${VAVOOM_MAIN_DEPS})
795 install(TARGETS k8vavoom DESTINATION ${BINDIR})
800 install(FILES ${CMAKE_SOURCE_DIR}/docs/k8vavoom.txt DESTINATION ${DATADIR})
801 install(FILES ${CMAKE_SOURCE_DIR}/res/k8vavoom.png DESTINATION ${DATADIR})
803 install(FILES ${CMAKE_SOURCE_DIR}/docs/code_of_conduct.txt DESTINATION ${DATADIR}/docs)
804 install(FILES ${CMAKE_SOURCE_DIR}/README DESTINATION ${DATADIR}/docs)
807 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon2.ico DESTINATION ${DATADIR}/icons)
808 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon3.ico DESTINATION ${DATADIR}/icons)
809 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon4.ico DESTINATION ${DATADIR}/icons)
810 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon5.ico DESTINATION ${DATADIR}/icons)
811 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon6.ico DESTINATION ${DATADIR}/icons)
812 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon7.ico DESTINATION ${DATADIR}/icons)
813 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon8.ico DESTINATION ${DATADIR}/icons)
814 install(FILES ${CMAKE_SOURCE_DIR}/res/ico/k8vavoom_icon9.ico DESTINATION ${DATADIR}/icons)
816 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon2.png DESTINATION ${DATADIR}/icons)
817 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon3.png DESTINATION ${DATADIR}/icons)
818 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon4.png DESTINATION ${DATADIR}/icons)
819 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon5.png DESTINATION ${DATADIR}/icons)
820 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon6.png DESTINATION ${DATADIR}/icons)
821 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon7.png DESTINATION ${DATADIR}/icons)
822 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon8.png DESTINATION ${DATADIR}/icons)
823 install(FILES ${CMAKE_SOURCE_DIR}/res/png/k8vavoom_icon9.png DESTINATION ${DATADIR}/icons)
826 # some specs and demos
828 set(DSPECSDIR ${SPECSDIR})
830 set(DSPECSDIR ${DATADIR}/${SPECSDIR})
833 #install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/k8vavoom_3dpobj.html DESTINATION ${DSPECSDIR}/3dpobj)
834 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/k8vavoom_3dpobj.wiki DESTINATION ${DSPECSDIR}/3dpobj)
835 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/fig1.png DESTINATION ${DSPECSDIR}/3dpobj)
836 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/zacc_acs/zdefs.acs DESTINATION ${DSPECSDIR}/3dpobj/zacc_acs)
837 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/zacc_acs/zspecial.acs DESTINATION ${DSPECSDIR}/3dpobj/zacc_acs)
838 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/3d_polyobject_cabin_crush.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
839 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/3d_polyobject_cabin_crush_side.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
840 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/3d_polyobject_cabin_railings.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
841 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/3d_polyobject_cabin_railings_blockhitscan.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
842 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/3d_polyobject_cabin_railings_blockproj.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
843 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/3d_polyobject_cabin_simple.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
844 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/big_dropoff.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
845 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/big_sight_faraway.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
846 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/empty.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
847 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/rotate.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
848 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/rotate_empty.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
849 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/simple_test.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads)
850 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/boris/3dpolyobj_testmap00.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads/boris)
851 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/complex/3d_polyobject_cabin_move_spot.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads/complex)
852 install(FILES ${CMAKE_SOURCE_DIR}/specs/3dpobj/sample_wads/complex/3d_polyobject_cabin_move_spot_doors.wad DESTINATION ${DSPECSDIR}/3dpobj/sample_wads/complex)
854 install(FILES ${CMAKE_SOURCE_DIR}/specs/index.wiki DESTINATION ${DSPECSDIR})
855 install(FILES ${CMAKE_SOURCE_DIR}/specs/udmf_k8vavoom.txt DESTINATION ${DSPECSDIR})
856 install(FILES ${CMAKE_SOURCE_DIR}/specs/k8vavoom_terrain_bootprints.txt DESTINATION ${DSPECSDIR})
857 install(FILES ${CMAKE_SOURCE_DIR}/specs/k8vavoom_pointlights.txt DESTINATION ${DSPECSDIR})
858 install(FILES ${CMAKE_SOURCE_DIR}/specs/k8vavoom_decals.txt DESTINATION ${DSPECSDIR})
859 install(FILES ${CMAKE_SOURCE_DIR}/specs/k8vavoom_decorate.txt DESTINATION ${DSPECSDIR})
861 install(FILES ${CMAKE_SOURCE_DIR}/specs/unfinished/k8vavoom_models.txt DESTINATION ${DSPECSDIR}/unfinished)
863 install(FILES ${CMAKE_SOURCE_DIR}/specs/umapinfo.txt DESTINATION ${DSPECSDIR})
864 install(FILES ${CMAKE_SOURCE_DIR}/specs/udmf.txt DESTINATION ${DSPECSDIR})
865 install(FILES ${CMAKE_SOURCE_DIR}/specs/udmf_zdoom.txt DESTINATION ${DSPECSDIR})
866 install(FILES ${CMAKE_SOURCE_DIR}/specs/usdf.txt DESTINATION ${DSPECSDIR})
867 install(FILES ${CMAKE_SOURCE_DIR}/specs/usdf_zdoom.txt DESTINATION ${DSPECSDIR})
868 install(FILES ${CMAKE_SOURCE_DIR}/specs/usdf_gzdoom.txt DESTINATION ${DSPECSDIR})
870 install(FILES ${CMAKE_SOURCE_DIR}/specs/vwad/vwad_fmt.txt DESTINATION ${DSPECSDIR}/vwad)
873 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/k8vavoom
875 # Needed to make symlinks/shortcuts work.
876 # the binaries must run with correct working directory
877 exec \"${CMAKE_INSTALL_PREFIX}/${BINDIR}/k8vavoom.bin\" \"\$\@\" -basedir \"${CMAKE_INSTALL_PREFIX}/${DATADIR}\" ${IWADDIR}
879 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/k8vavoom DESTINATION ${BINDIR})
880 endif(ENABLE_WRAPPERS)
884 TARGET k8vavoom POST_BUILD
885 COMMAND nacptool --create "${CMAKE_PROJECT_NAME}" \"\" \"\" "k8vavoom.nacp"
886 COMMAND aarch64-none-elf-strip -o "${CMAKE_BINARY_DIR}/k8vavoom_stripped" "${CMAKE_BINARY_DIR}/k8vavoom"
887 COMMAND elf2nro "${CMAKE_BINARY_DIR}/k8vavoom_stripped" "${CMAKE_BINARY_DIR}/k8vavoom.nro" --icon="${CMAKE_SOURCE_DIR}/branding/k8vavoom_switch.jpg" --nacp=k8vavoom.nacp
893 #---------------------------------------
897 #---------------------------------------
900 ### set(SERVER_SOURCES ${SERVER_COMMON_SOURCES} winshit/sys_wind.cpp)
902 ### # CMake doesn't support automatic building of resource files so
903 ### # we must add a custom command and add object files to the list
904 ### # of source files
905 ### ### set(RC_SRC ${CMAKE_CURRENT_SOURCE_DIR}/winshit/res/k8vavoom.rc)
906 ### ### set(RC_OBJ ${CMAKE_CURRENT_BINARY_DIR}/winshit/res/k8vavoom_sv.o)
907 ### ### add_custom_command(OUTPUT ${RC_OBJ}
908 ### ### DEPENDS ${RC_SRC}
909 ### ### COMMAND windres --include-dir=${CMAKE_CURRENT_SOURCE_DIR} --include-dir=${CMAKE_CURRENT_BINARY_DIR} -o ${RC_OBJ} -i ${RC_SRC}
911 ### ### set(SERVER_SOURCES ${SERVER_SOURCES} ${RC_OBJ})
912 ### #set(SERVER_SOURCES ${SERVER_SOURCES})
914 ### set(SERVER_SOURCES ${SERVER_COMMON_SOURCES} sys_ded.cpp)
916 set(SERVER_SOURCES ${SERVER_COMMON_SOURCES} sys_ded.cpp)
918 add_executable(k8vavoom-dedicated ${SERVER_SOURCES})
920 set_target_properties(k8vavoom-dedicated PROPERTIES LINK_FLAGS "-Wl,--subsystem,console")
924 set_target_properties(k8vavoom-dedicated PROPERTIES OUTPUT_NAME ../k8vavoom-dedicated.bin)
925 else(ENABLE_WRAPPERS)
926 set_target_properties(k8vavoom-dedicated PROPERTIES OUTPUT_NAME ../k8vavoom-dedicated)
927 endif(ENABLE_WRAPPERS)
928 set_target_properties(k8vavoom-dedicated PROPERTIES COMPILE_FLAGS -DSERVER)
929 #FIXME: create separate from MAIN_LIBS link list
930 #target_link_libraries(k8vavoom-dedicated glbsp vavoomc core ${MAIN_LIBS} ${NET_LIBRARIES})
931 target_link_libraries(k8vavoom-dedicated vavoomc core ${MAIN_LIBS} ${NET_LIBRARIES})
932 #add_dependencies(k8vavoom-dedicated core vavoomc glbsp ${VAVOOM_MAIN_DEPS})
933 add_dependencies(k8vavoom-dedicated core vavoomc ${VAVOOM_MAIN_DEPS})
935 install(TARGETS k8vavoom-dedicated DESTINATION ${BINDIR})
938 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/k8vavoom-dedicated
940 # Needed to make symlinks/shortcuts work.
941 # the binaries must run with correct working directory
942 exec \"${CMAKE_INSTALL_PREFIX}/${BINDIR}/k8vavoom-dedicated.bin\" \"\$\@\" -basedir \"${CMAKE_INSTALL_PREFIX}/${DATADIR}\" ${IWADDIR}
944 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/k8vavoom-dedicated DESTINATION ${BINDIR})
945 endif(ENABLE_WRAPPERS)