SET (MAIN_SOURCES 
		Descent3/aiambient.h
		Descent3/AIGoal.h
		Descent3/AIMain.h
		Descent3/aipath.h
		Descent3/aistruct.h
		Descent3/aistruct_external.h
		Descent3/aiterrain.h
		Descent3/ambient.h
		Descent3/args.h
		Descent3/attach.h
		Descent3/audiotaunts.h
		Descent3/bnode.h
		Descent3/BOA.h
		Descent3/Briefing.h
		Descent3/BriefingParse.h
		Descent3/bsp.h
		Descent3/buddymenu.h
		Descent3/buildno.h
		Descent3/cinematics.h
		Descent3/cockpit.h
		Descent3/config.h
		Descent3/ConfigItem.h
		Descent3/controls.h
		Descent3/credits.h
		Descent3/CtlCfgElem.h
		Descent3/ctlconfig.h
		Descent3/ctlconfigtxt.h
		Descent3/D3ForceFeedback.h
		Descent3/damage.h
		Descent3/damage_external.h
		Descent3/DeathInfo.h
		Descent3/deathinfo_external.h
		Descent3/debuggraph.h
		Descent3/descent.h
		Descent3/difficulty.h
		Descent3/difficulty_external.h
		Descent3/DllWrappers.h
		Descent3/door.h
		Descent3/doorway.h
		Descent3/fireball.h
		Descent3/fireball_external.h
		Descent3/game.h
		Descent3/gamecinematics.h
		Descent3/gamecinematics_external.h
		Descent3/gameevent.h
		Descent3/gamefile.h
		Descent3/gamefont.h
		Descent3/gameloop.h
		Descent3/gamepath.h
		Descent3/gamesave.h
		Descent3/gamesequence.h
		Descent3/gamespy.h
		Descent3/gamespyutils.h
		Descent3/gametexture.h
		Descent3/gauges.h
		Descent3/help.h
		Descent3/hotspotmap.h
		Descent3/hud.h
		Descent3/init.h
		Descent3/Inventory.h
		Descent3/levelgoal.h
		Descent3/levelgoal_external.h
		Descent3/lighting.h
		Descent3/lightmap_info.h
		Descent3/list.h
		Descent3/LoadLevel.h
		Descent3/localization.h
		Descent3/marker.h
		Descent3/matcen.h
		Descent3/matcen_external.h
		Descent3/menu.h
		Descent3/Mission.h
		Descent3/mission_download.h
		Descent3/mmItem.h
		Descent3/multi.h
		Descent3/multisafe.h
		Descent3/multi_client.h
		Descent3/multi_dll_mgr.h
		Descent3/multi_external.h
		Descent3/multi_save_settings.h
		Descent3/multi_server.h
		Descent3/multi_ui.h
		Descent3/multi_world_state.h
		Descent3/newrender.cpp
		Descent3/newrender.h
		Descent3/newui.h
		Descent3/newui_core.h
		Descent3/object.h
		Descent3/object_external.h
		Descent3/object_external_struct.h
		Descent3/object_lighting.h
		Descent3/objinfo.h
		Descent3/objinit.h
		Descent3/ObjScript.h
		Descent3/osiris_dll.h
		Descent3/osiris_predefs.h
		Descent3/osiris_share.h
		Descent3/pilot.h
		Descent3/PilotPicsAPI.h
		Descent3/pilot_class.h
		Descent3/player.h
		Descent3/player_external.h
		Descent3/player_external_struct.h
		Descent3/postrender.h
		Descent3/powerup.h
		Descent3/procedurals.h
		Descent3/program.h
		Descent3/render.h
		Descent3/renderobject.h
		Descent3/resource.h
		Descent3/robot.h
		Descent3/robotfire.h
		Descent3/robotfirestruct.h
		Descent3/robotfirestruct_external.h
		Descent3/room.h
		Descent3/room_external.h
		Descent3/scorch.h
		Descent3/screens.h
		Descent3/ship.h
		Descent3/slew.h
		Descent3/SmallViews.h
		Descent3/sounds.h
		Descent3/special_face.h
		Descent3/spew.h
		Descent3/splinter.h
		Descent3/stringtable.h
		Descent3/subtitles.h
		Descent3/TelCom.h
		Descent3/TelComAutoMap.h
		Descent3/TelComCargo.h
		Descent3/TelComEffects.h
		Descent3/TelComEfxStructs.h
		Descent3/TelComGoals.h
		Descent3/terrain.h
		Descent3/trigger.h
		Descent3/vclip.h
		Descent3/vibeinterface.h
		Descent3/viseffect.h
		Descent3/viseffect_external.h
		Descent3/weapon.h
		Descent3/weapon_external.h
		Descent3/weather.h
		Descent3/aiambient.cpp
		Descent3/AIGoal.cpp
		Descent3/AImain.cpp
		Descent3/aipath.cpp
		Descent3/aiterrain.cpp
		Descent3/ambient.cpp
		Descent3/args.cpp
		Descent3/attach.cpp
		Descent3/audiotaunts.cpp
		Descent3/bnode.cpp
		Descent3/BOA.cpp
		Descent3/Briefing.cpp
		Descent3/BriefingParse.cpp
		Descent3/bsp.cpp
		Descent3/buddymenu.cpp
		Descent3/cinematics.cpp
		Descent3/cockpit.cpp
		Descent3/config.cpp
		Descent3/ConfigItem.cpp
		Descent3/Controls.cpp
		Descent3/credits.cpp
		Descent3/CtlCfgElem.cpp
		Descent3/ctlconfig.cpp
		Descent3/D3ForceFeedback.cpp
		Descent3/damage.cpp
		Descent3/debuggraph.cpp
		Descent3/dedicated_server.cpp
		Descent3/demofile.cpp
		Descent3/descent.cpp
		Descent3/difficulty.cpp
		Descent3/DllWrappers.cpp
		Descent3/door.cpp
		Descent3/doorway.cpp
		Descent3/fireball.cpp
		Descent3/game.cpp
		Descent3/Game2DLL.cpp
		Descent3/GameCheat.cpp
		Descent3/gamecinematics.cpp
		Descent3/gameevent.cpp
		Descent3/gamefile.cpp
		Descent3/gamefont.cpp
		Descent3/GameLoop.cpp
		Descent3/gamepath.cpp
		Descent3/gamesave.cpp
		Descent3/gamesequence.cpp
		Descent3/gamespy.cpp
		Descent3/gamespyutils.cpp
		Descent3/gametexture.cpp
		Descent3/gauges.cpp
		Descent3/help.cpp
		Descent3/hotspotmap.cpp
		Descent3/hud.cpp
		Descent3/huddisplay.cpp
		Descent3/hudmessage.cpp
		Descent3/init.cpp
		Descent3/intellivibe.cpp
		Descent3/Inventory.cpp
		Descent3/levelgoal.cpp
		Descent3/lighting.cpp
		Descent3/lightmap_info.cpp
		Descent3/list.cpp
		Descent3/LoadLevel.cpp
		Descent3/loadstate.cpp
		Descent3/localization.cpp
		Descent3/marker.cpp
		Descent3/matcen.cpp
		Descent3/megacell.cpp
		Descent3/menu.cpp
		Descent3/Mission.cpp
		Descent3/mission_download.cpp
		Descent3/mmItem.cpp
		Descent3/multi.cpp
		Descent3/multisafe.cpp
		Descent3/multisafe_server.cpp
		Descent3/multi_client.cpp
		Descent3/multi_connect.cpp
		Descent3/multi_dll_mgr.cpp
		Descent3/multi_save_setting.cpp
		Descent3/multi_server.cpp
		Descent3/multi_ui.cpp
		Descent3/newui.cpp
		Descent3/newui_core.cpp
		Descent3/newui_filedlg.cpp
		Descent3/object.cpp
		Descent3/object_lighting.cpp
		Descent3/objinfo.cpp
		Descent3/ObjInit.cpp
		Descent3/ObjScript.cpp
		Descent3/OsirisLoadandBind.cpp
		Descent3/osiris_predefs.cpp
		Descent3/pilot.cpp
		Descent3/PilotPicsAPI.cpp
		Descent3/pilot_class.cpp
		Descent3/Player.cpp
		Descent3/postrender.cpp
		Descent3/procedurals.cpp
		Descent3/program.cpp
		Descent3/render.cpp
		Descent3/renderobject.cpp
		Descent3/robotfire.cpp
		Descent3/room.cpp
		Descent3/scorch.cpp
		Descent3/screens.cpp
		Descent3/ship.cpp
		Descent3/SLEW.cpp
		Descent3/SmallViews.cpp
		Descent3/special_face.cpp
		Descent3/spew.cpp
		Descent3/splinter.cpp
		Descent3/subtitles.cpp
		Descent3/TelCom.cpp
		Descent3/TelComAutoMap.cpp
		Descent3/TelComCargo.cpp
		Descent3/TelComEffects.cpp
		Descent3/TelcomEffectsRender.cpp
		Descent3/TelComGoals.cpp
		Descent3/terrain.cpp
		Descent3/terrainrender.cpp
		Descent3/TerrainSearch.cpp
		Descent3/trigger.cpp
		Descent3/vclip.cpp
		Descent3/viseffect.cpp
		Descent3/weapon.cpp
		Descent3/WeaponFire.cpp
		Descent3/weather.cpp)
		
IF (WIN32)
	if (USE_SDL)
	SET (MAIN_SOURCES ${MAIN_SOURCES}
		Descent3/sdlmain.cpp
		)
	else()
	SET (MAIN_SOURCES ${MAIN_SOURCES}
		Descent3/winmain.cpp
		)
	endif()
	SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBC")
ENDIF()

IF (UNIX AND NOT APPLE)
	SET (MAIN_SOURCES ${MAIN_SOURCES}
		Descent3/loki_utils.cpp
		Descent3/lnxmain.cpp)
ENDIF()

IF (APPLE)
	SET (MAIN_SOURCES ${MAIN_SOURCES}
		Descent3/loki_utils.cpp
		Descent3/lnxmain.cpp
		Descent3/SDLMain.m)
ENDIF()

file(GLOB_RECURSE INCS "../lib/*.h")
SET (MAIN_SOURCES ${MAIN_SOURCES} ${INCS})
SET (MAIN_SOURCES ${MAIN_SOURCES} PARENT_SCOPE)