set(HEADERS aiambient.h AIGoal.h AIMain.h aipath.h aistruct.h aistruct_external.h aiterrain.h ambient.h args.h attach.h audiotaunts.h bnode.h BOA.h Briefing.h BriefingParse.h bsp.h buddymenu.h cinematics.h cockpit.h config.h ConfigItem.h controls.h credits.h CtlCfgElem.h ctlconfig.h ctlconfigtxt.h D3ForceFeedback.h d3serial.h damage.h damage_external.h DeathInfo.h deathinfo_external.h debuggraph.h descent.h difficulty.h difficulty_external.h DllWrappers.h door.h doorway.h fireball.h fireball_external.h game.h gamecinematics.h gamecinematics_external.h gameevent.h gamefile.h gamefont.h gameloop.h gamepath.h gamesave.h gamesequence.h gametexture.h gauges.h help.h hotspotmap.h hud.h init.h Inventory.h levelgoal.h levelgoal_external.h lighting.h lightmap_info.h list.h LoadLevel.h localization.h marker.h matcen.h matcen_external.h menu.h Mission.h mission_download.h mmItem.h multi.h multisafe.h multi_client.h multi_dll_mgr.h multi_external.h multi_save_settings.h multi_server.h multi_ui.h multi_world_state.h NewPyroGauges.h newui.h newui_core.h object.h object_external.h object_external_struct.h object_lighting.h objinfo.h objinit.h ObjScript.h osiris_dll.h osiris_predefs.h osiris_share.h pilot.h PilotPicsAPI.h pilot_class.h player.h player_external.h player_external_struct.h postrender.h powerup.h procedurals.h program.h render.h renderobject.h resource.h robot.h robotfire.h robotfirestruct.h robotfirestruct_external.h room.h room_external.h scorch.h screens.h ship.h slew.h SmallViews.h soar.h soar_helpers.h sounds.h special_face.h spew.h splinter.h stringtable.h subtitles.h TelCom.h TelComAutoMap.h TelComCargo.h TelComEffects.h TelComEfxStructs.h TelComGoals.h terrain.h trigger.h vclip.h vibeinterface.h viseffect.h viseffect_external.h voice.h weapon.h weapon_external.h weather.h) set(CPPS aiambient.cpp AIGoal.cpp AImain.cpp aipath.cpp aiterrain.cpp ambient.cpp args.cpp attach.cpp audiotaunts.cpp bnode.cpp BOA.cpp Briefing.cpp BriefingParse.cpp bsp.cpp buddymenu.cpp cinematics.cpp cockpit.cpp config.cpp ConfigItem.cpp Controls.cpp credits.cpp CtlCfgElem.cpp ctlconfig.cpp D3ForceFeedback.cpp d3serial.cpp damage.cpp debuggraph.cpp dedicated_server.cpp demofile.cpp descent.cpp difficulty.cpp DllWrappers.cpp door.cpp doorway.cpp fireball.cpp game.cpp Game2DLL.cpp GameCheat.cpp gamecinematics.cpp gameevent.cpp gamefile.cpp gamefont.cpp GameLoop.cpp gamepath.cpp gamesave.cpp gamesequence.cpp gametexture.cpp gauges.cpp help.cpp hotspotmap.cpp hud.cpp huddisplay.cpp hudmessage.cpp init.cpp intellivibe.cpp Inventory.cpp levelgoal.cpp lighting.cpp lightmap_info.cpp list.cpp LoadLevel.cpp loadstate.cpp localization.cpp marker.cpp matcen.cpp megacell.cpp menu.cpp Mission.cpp mission_download.cpp mmItem.cpp multi.cpp multisafe.cpp multisafe_server.cpp multi_client.cpp multi_connect.cpp multi_dll_mgr.cpp multi_save_setting.cpp multi_server.cpp multi_ui.cpp NewPyroGauges.cpp newui.cpp newui_core.cpp newui_filedlg.cpp object.cpp object_lighting.cpp objinfo.cpp ObjInit.cpp ObjScript.cpp OsirisLoadandBind.cpp osiris_predefs.cpp pilot.cpp PilotPicsAPI.cpp pilot_class.cpp Player.cpp postrender.cpp procedurals.cpp program.cpp render.cpp renderobject.cpp robotfire.cpp room.cpp scorch.cpp screens.cpp ship.cpp SLEW.cpp SmallViews.cpp soar.cpp soar_helpers.cpp special_face.cpp spew.cpp splinter.cpp subtitles.cpp TelCom.cpp TelComAutoMap.cpp TelComCargo.cpp TelComEffects.cpp TelcomEffectsRender.cpp TelComGoals.cpp terrain.cpp terrainrender.cpp TerrainSearch.cpp trigger.cpp vclip.cpp viseffect.cpp voice.cpp weapon.cpp WeaponFire.cpp weather.cpp) if(WIN32) set(PLATFORM_LIBS dd_grwin32 win32 wsock32.lib winmm.lib ${DSOUND_LIBRARY} ${DINPUT_LIBRARY} ${DXGUID_LIBRARY} ${DDRAW_LIBRARY}) set(PLATFORM_CPPS winmain.cpp) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:LIBC") endif() if(UNIX AND NOT APPLE) set(PLATFORM_LIBS linux SDL2::SDL2 m ${CMAKE_DL_LIBS}) set(PLATFORM_CPPS loki_utils.c lnxmain.cpp) endif() if(APPLE) set(PLATFORM_LIBS linux SDL2::SDL2) set(PLATFORM_CPPS loki_utils.c lnxmain.cpp) set(CMAKE_EXE_LINKER_FLAGS "-framework IOKit -framework Cocoa -framework OpenGL -framework Carbon") endif() file(GLOB_RECURSE INCS "../lib/*.h") add_executable(Descent3 WIN32 ${HEADERS} ${CPPS} ${PLATFORM_CPPS} ${INCS} ) target_link_libraries(Descent3 2dlib AudioEncode bitmap cfile czip d3music dd_video ddebug ddio libmve libacm fix grtext manage mem misc model module movie stream_audio music networking physics renderer rtperformance sndlib ui unzip vecmat md5 ${PLATFORM_LIBS}) target_include_directories(Descent3 PRIVATE ${PROJECT_BINARY_DIR}/lib) add_dependencies(Descent3 get_git_hash Direct_TCP_IP_Hog HogFull NetgamesDir Parallax_Online_Hog) install(TARGETS Descent3 RUNTIME) if(BUILD_TESTING) add_subdirectory(tests) endif()