/*
	$Id: workspace_generator_msvc.cpp,v 1.128 2004/05/09 14:44:44 mbn Exp $

	------------------------------------------------------------------------
	ClanLib, the platform independent game SDK.

	This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
	version 2. See COPYING for details.

	For a total list of contributers see CREDITS.

	------------------------------------------------------------------------
*/

#include "stdafx.h"
#include "workspace_generator_msvc.h"
#include <vector>

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC6 construction:

WorkspaceGenerator_MSVC6::WorkspaceGenerator_MSVC6()
{
}

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC6 attributes:

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC6 operations:

void WorkspaceGenerator_MSVC6::write(const Workspace &workspace)
{
	write_dsw(workspace);

	std::list<Project>::const_iterator itProject;
	for (itProject = workspace.projects.begin(); itProject != workspace.projects.end(); itProject++)
	{
		const Project &project = *itProject;
		write_dsp(workspace, project);
	}
}

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC6 implementation:

void WorkspaceGenerator_MSVC6::write_dsw(const Workspace &workspace)
{
	write_dsw_clanlib(workspace);
	write_dsw_utilities(workspace);
	write_dsw_examples(workspace);
	write_dsw_tests(workspace);
}

void WorkspaceGenerator_MSVC6::write_dsw_examples(const Workspace &workspace)
{
	std::ofstream dsw("Examples.dsw");

	write_dsw_header(dsw);

	begin_project(dsw, "ExampleAdventureScene", ".\\Examples\\AdventureScene\\AdventureScene.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleBasic2D", ".\\Examples\\Basic2D\\Basic2D.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleBlendFunctions", ".\\Examples\\BlendFunctions\\BlendFunctions.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleCanvas", ".\\Examples\\Canvas\\Canvas.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleCommandLine", ".\\Examples\\CommandLine\\CommandLine.dsp");
	add_project_dependency(dsw, "clanCore");
	end_project(dsw);

	begin_project(dsw, "ExampleCTalk", ".\\Examples\\CTalk\\CTalk.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanNetwork");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleDirectory", ".\\Examples\\Directory\\Directory.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleDisplayModes", ".\\Examples\\DisplayModes\\DisplayModes.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleExePath", ".\\Examples\\ExePath\\ExePath.dsp");
	add_project_dependency(dsw, "clanCore");
	end_project(dsw);

	begin_project(dsw, "ExampleFont", ".\\Examples\\Font\\Font.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

 	begin_project(dsw, "ExampleGLCube", ".\\Examples\\GLCube\\GLCube.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

 	begin_project(dsw, "ExampleGLFog", ".\\Examples\\GLFog\\GLFog.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

 	begin_project(dsw, "ExampleGLGUICube", ".\\Examples\\GLGUICube\\GLGUICube.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

 	begin_project(dsw, "ExampleGlyphBuffer", ".\\Examples\\GlyphBuffer\\GlyphBuffer.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleGUILayout", ".\\Examples\\GUILayout\\GUILayout.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleGUIInputDialog", ".\\Examples\\GUIInputDialog\\GUIInputDialog.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleGUIScript", ".\\Examples\\GUIScript\\GUIScript.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleGUISimple", ".\\Examples\\GUISimple\\GUISimple.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleGUIStyle", ".\\Examples\\GUIStyle\\GUIStyle.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleGUITreeView", ".\\Examples\\GUITreeView\\GUITreeView.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleGUIWindow", ".\\Examples\\GUIWindow\\GUIWindow.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleInitDisplay", ".\\Examples\\InitDisplay\\InitDisplay.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleIRCBot", ".\\Examples\\IRCBot\\IRCBot.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanNetwork");
	end_project(dsw);

	begin_project(dsw, "ExampleJoystick", ".\\Examples\\Joystick\\Joystick.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleMikMod", ".\\Examples\\MikMod\\MikMod.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanMikMod");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleMinimum", ".\\Examples\\Minimum\\Minimum.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleMousePoll", ".\\Examples\\MousePoll\\MousePoll.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleMouseSignal", ".\\Examples\\MouseSignal\\MouseSignal.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleNetChannel", ".\\Examples\\NetChannel\\NetChannel.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanNetwork");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleNetFTP", ".\\Examples\\NetFTP\\NetFTP.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanNetwork");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExamplePacman", ".\\Examples\\Pacman\\Pacman.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanSound");
	end_project(dsw);

	begin_project(dsw, "ExamplePilotsPuzzle", ".\\Examples\\PilotsPuzzle\\PilotsPuzzle.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExamplePlayCD", ".\\Examples\\PlayCD\\PlayCD.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleResources", ".\\Examples\\Resources\\Resources.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleResourcesCustom", ".\\Examples\\ResourcesCustom\\ResourcesCustom.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleScreenShot", ".\\Examples\\ScreenShot\\ScreenShot.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleShadowOfTheBeast", ".\\Examples\\ShadowOfTheBeast\\ShadowOfTheBeast.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleStencil", ".\\Examples\\Stencil\\Stencil.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleSignals", ".\\Examples\\Signals\\Signals.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleSoundBuffer", ".\\Examples\\SoundBuffer\\SoundBuffer.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleSoundFilters", ".\\Examples\\SoundFilters\\SoundFilters.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanDisplay");
	end_project(dsw);

	begin_project(dsw, "ExampleSpritesRTS", ".\\Examples\\SpritesRTS\\SpritesRTS.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleSoundProvider", ".\\Examples\\StreamSoundProvider\\StreamSoundProvider.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleSurface", ".\\Examples\\Surface\\Surface.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleThreadSync", ".\\Examples\\ThreadSync\\ThreadSync.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleTime", ".\\Examples\\Time\\Time.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ExampleUDPTunnel", ".\\Examples\\UDPTunnel\\UDPTunnel.dsp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanNetwork");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleVorbis", ".\\Examples\\Vorbis\\Vorbis.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanVorbis");
	add_project_dependency(dsw, "clanSound");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleXML", ".\\Examples\\XML\\XML.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ExampleZip", ".\\Examples\\Zip\\Zip.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	end_project(dsw);

	write_dsw_tail(dsw);
}

void WorkspaceGenerator_MSVC6::write_dsw_utilities(const Workspace &workspace)
{
	std::ofstream dsw("Utilities.dsw");

	write_dsw_header(dsw);

	begin_project(dsw, "GUIEditor", ".\\Utilities\\GUIEditor\\GUIEditor.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	write_dsw_tail(dsw);
}

void WorkspaceGenerator_MSVC6::write_dsw_tests(const Workspace &workspace)
{
	std::ofstream dsw("Tests.dsw");

	write_dsw_header(dsw);

	begin_project(dsw, "Collision", ".\\Tests\\Collision\\Collision.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "Disp2Test", ".\\Tests\\Disp2Test\\Disp2Test.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "GfxBenchmark", ".\\Tests\\GfxBenchmark\\GfxBenchmark.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "TextStylerTest", ".\\Tests\\TextStylerTest\\TextStylerTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "GUITest", ".\\Tests\\GUITest\\GUITest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "ListBoxTest", ".\\Tests\\ListBoxTest\\ListBoxTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanGUI");
	add_project_dependency(dsw, "clanGUIStyleSilver");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanGL");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "AlphaTest", ".\\Tests\\AlphaTest\\AlphaTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanJPEG");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "InputButtonTest", ".\\Tests\\InputButtonTest\\InputButtonTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "InputTest", ".\\Tests\\InputTest\\InputTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	end_project(dsw);

	begin_project(dsw, "GLSpeedTest", ".\\Tests\\GLSpeedTest\\GLSpeedTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "StateTreeTest", ".\\Tests\\StateTreeTest\\StateTreeTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "SpriteTest", ".\\Tests\\SpriteTest\\SpriteTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "FontTest", ".\\Tests\\FontTest\\FontTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "TextureSizeTest", ".\\Tests\\TextureSizeTest\\TextureSizeTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ProviderTest", ".\\Tests\\PrimitivesTest\\PrimitivesTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "ProviderTest", ".\\Tests\\ProviderTest\\ProviderTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanDisplay");
	add_project_dependency(dsw, "clanSignals");
	add_project_dependency(dsw, "clanGL");
	end_project(dsw);

	begin_project(dsw, "NetSessionsTest", ".\\Tests\\NetSessionsTest\\NetSessionsTest.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanNetwork");
	end_project(dsw);

	begin_project(dsw, "SocketTestClient", ".\\Tests\\SocketTest\\SocketTestClient.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanNetwork");
	end_project(dsw);

	begin_project(dsw, "SocketTestServer", ".\\Tests\\SocketTest\\SocketTestServer.dsp");
	add_project_dependency(dsw, "clanApp");
	add_project_dependency(dsw, "clanCore");
	add_project_dependency(dsw, "clanNetwork");
	end_project(dsw);

	write_dsw_tail(dsw);
}

void WorkspaceGenerator_MSVC6::write_dsw_clanlib(const Workspace &workspace)
{
	std::ofstream dsw("ClanLib.dsw");

	write_dsw_header(dsw);

	std::string dsp_path(".\\Sources\\");

	std::list<Project>::const_iterator itProject;
	for (itProject = workspace.projects.begin(); itProject != workspace.projects.end(); itProject++)
	{
		const Project &project = *itProject;

		begin_project(dsw, project.libname, dsp_path+project.libname+std::string(".dsp"));

		std::list<std::string>::const_iterator it;
		for (it = project.dependencies.begin(); it != project.dependencies.end(); it++)
		{
			const std::string &dep = *it;
			add_project_dependency(dsw, dep);
		}

		end_project(dsw);
	}

	write_dsw_tail(dsw);
}

void WorkspaceGenerator_MSVC6::begin_project(
	std::ofstream &dsw,
	const std::string &name,
	const std::string &filename)
{
	dsw << "Project: \"" << name.c_str() << "\"=\"" << filename.c_str() << "\" - Package Owner=<4>" << std::endl;
	dsw << std::endl;
	dsw << "Package=<5>" << std::endl;
	dsw << "{{{" << std::endl;
	dsw << "}}}" << std::endl;
	dsw << std::endl;
	dsw << "Package=<4>" << std::endl;
	dsw << "{{{" << std::endl;
}

void WorkspaceGenerator_MSVC6::end_project(std::ofstream &dsw)
{
	dsw << "}}}" << std::endl;
	dsw << std::endl;
	dsw << "###############################################################################" << std::endl;
	dsw << std::endl;
}

void WorkspaceGenerator_MSVC6::add_project_dependency(
	std::ofstream &dsw,
	const std::string &dep_name)
{
	dsw << "    Begin Project Dependency" << std::endl;
	dsw << "    Project_Dep_Name " << dep_name.c_str() << std::endl;
	dsw << "    End Project Dependency" << std::endl;
}

void WorkspaceGenerator_MSVC6::write_dsw_header(std::ofstream &dsw)
{
	dsw << "Microsoft Developer Studio Workspace File, Format Version 6.00" << std::endl;
	dsw << "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!" << std::endl;
	dsw << std::endl;
	dsw << "###############################################################################" << std::endl;
	dsw << std::endl;
}

void WorkspaceGenerator_MSVC6::write_dsw_tail(std::ofstream &dsw)
{
	dsw << "Global:" << std::endl;
	dsw << std::endl;
	dsw << "Package=<5>" << std::endl;
	dsw << "{{{" << std::endl;
	dsw << "}}}" << std::endl;
	dsw << std::endl;
	dsw << "Package=<3>" << std::endl;
	dsw << "{{{" << std::endl;
	dsw << "}}}" << std::endl;
	dsw << std::endl;
	dsw << "###############################################################################" << std::endl;
	dsw << std::endl;
}

void WorkspaceGenerator_MSVC6::write_dsp(const Workspace &workspace, const Project &project)
{
	CString filename = "Sources\\";
	filename += project.libname.c_str();
	filename += ".dsp";

	std::ofstream dsp(filename);

	dsp << "# Microsoft Developer Studio Project File - Name=\"" << project.libname.c_str() << "\" - Package Owner=<4>" << std::endl;
	dsp << "# Microsoft Developer Studio Generated Build File, Format Version 6.00" << std::endl;
	dsp << "# ** DO NOT EDIT **" << std::endl;
	dsp << std::endl;
	dsp << "# TARGTYPE \"Win32 (x86) Static Library\" 0x0104" << std::endl;
	dsp << std::endl;
	dsp << "CFG=" << project.libname.c_str() << " - Win32 Release" << std::endl;
	dsp << "!MESSAGE This is not a valid makefile. To build this project using NMAKE," << std::endl;
	dsp << "!MESSAGE use the Export Makefile command and run" << std::endl;
	dsp << "!MESSAGE " << std::endl;
	dsp << "!MESSAGE NMAKE /f \"" << project.libname.c_str() << ".mak\"." << std::endl;
	dsp << "!MESSAGE " << std::endl;
	dsp << "!MESSAGE You can specify a configuration when running NMAKE" << std::endl;
	dsp << "!MESSAGE by defining the macro CFG on the command line. For example:" << std::endl;
	dsp << "!MESSAGE " << std::endl;
	dsp << "!MESSAGE NMAKE /f \"" << project.libname.c_str() << ".mak\" CFG=\"" << project.libname.c_str() << " - Win32 Release\"" << std::endl;
	dsp << "!MESSAGE " << std::endl;
	dsp << "!MESSAGE Possible choices for configuration are:" << std::endl;
	dsp << "!MESSAGE " << std::endl;
	dsp << "!MESSAGE \"" << project.libname.c_str() << " - Win32 Release\" (based on \"Win32 (x86) Static Library\")" << std::endl;
	dsp << "!MESSAGE \"" << project.libname.c_str() << " - Win32 Debug\" (based on \"Win32 (x86) Static Library\")" << std::endl;
	dsp << "!MESSAGE " << std::endl;
	dsp << std::endl;
	dsp << "# Begin Project" << std::endl;
	dsp << "# PROP AllowPerConfigDependencies 0" << std::endl;
	dsp << "# PROP Scc_ProjName \"\"" << std::endl;
	dsp << "# PROP Scc_LocalPath \"\"" << std::endl;
	dsp << "CPP=cl.exe" << std::endl;
	dsp << "RSC=rc.exe" << std::endl;
	dsp << std::endl;
	dsp << "!IF  \"$(CFG)\" == \"" << project.libname.c_str() << " - Win32 Release\"" << std::endl;
	dsp << std::endl;
	dsp << "# PROP BASE Use_MFC 0" << std::endl;
	dsp << "# PROP BASE Use_Debug_Libraries 0" << std::endl;
	dsp << "# PROP BASE Output_Dir \"../Release\"" << std::endl;
	dsp << "# PROP BASE Intermediate_Dir \"../Release/" << project.libname.c_str() << "\"" << std::endl;
	dsp << "# PROP BASE Target_Dir \"\"" << std::endl;
	dsp << "# PROP Use_MFC 0" << std::endl;
	dsp << "# PROP Use_Debug_Libraries 0" << std::endl;
	dsp << "# PROP Output_Dir \"../Release\"" << std::endl;
	dsp << "# PROP Intermediate_Dir \"../Release/" << project.libname.c_str() << "\"" << std::endl;
	dsp << "# PROP Target_Dir \"\"" << std::endl;
	dsp << "# ADD BASE CPP /MT /nologo /W3 /GR /GX /Zi /O2 /D \"WIN32\" /D \"NDEBUG\" /D \"_WINDOWS\"";
    if (project.name == "Core") // use precomp headers in clanCore.
		dsp << " /Yu\"Core\\precomp.h\" /FD /c" << std::endl;
	else if (project.name == "GUI")
		dsp << " /Yu\"precomp.h\" /FD /c" << std::endl;
	else if (project.name == "Display")
		dsp << " /Yu\"Display\\display_precomp.h\" /FD /c" << std::endl;
	else
		dsp << " /YX /FD /c" << std::endl;

	dsp << "# ADD CPP /nologo /MT /W3 /GR /GX /Zi /O2 /I \".\"";
	if (!workspace.input_include_dir.empty()) dsp << " /I \"" << workspace.input_include_dir.c_str() << "\"";
	dsp << " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\"";
	{
		for (
			std::list<std::string>::const_iterator it = project.defines_list.begin();
			it != project.defines_list.end();
			it++)
		{
			dsp << " /D \"" << (*it).c_str() << "\"";
		}
	}
    if (project.name == "Core") // use precomp headers in clanCore.
		dsp << " /Yu\"Core\\precomp.h\" /FD /c" << std::endl;
    else if (project.name == "GUI") // use precomp headers in clanCore.
		dsp << " /Yu\"precomp.h\" /FD /c" << std::endl;
	else if (project.name == "Display")
		dsp << " /Yu\"Display\\display_precomp.h\" /FD /c" << std::endl;
	else
		dsp << " /YX /FD /c" << std::endl;

	dsp << "# ADD BASE RSC /l 0x409 /d \"NDEBUG\"" << std::endl;
	dsp << "# ADD RSC /l 0x409 /d \"NDEBUG\"" << std::endl;
	dsp << "BSC32=bscmake.exe" << std::endl;
	dsp << "# ADD BASE BSC32 /nologo" << std::endl;
	dsp << "# ADD BSC32 /nologo" << std::endl;
	dsp << "LIB32=link.exe -lib" << std::endl;
	dsp << "# ADD BASE LIB32 /nologo";
	if (!workspace.input_lib_dir.empty()) dsp << " /libpath:\"" << workspace.input_lib_dir.c_str() << "\"";
	dsp << std::endl;

	dsp << "# ADD LIB32 ";
	{
		for (
			std::list<std::string>::const_iterator it = project.libs_shared.begin();
			it != project.libs_shared.end();
			it++)
		{
			dsp << " " << (*it).c_str() << "";
		}
	}
	{
		for (
			std::list<std::string>::const_iterator it = project.libs_release.begin();
			it != project.libs_release.end();
			it++)
		{
			dsp << " " << (*it).c_str() << "";
		}
	}
	dsp << " /nologo /out:\"" << workspace.output_lib_dir.c_str() << "\\" << project.libname.c_str() << ".lib\"" << std::endl;

	dsp << "# Begin Special Build Tool" << std::endl;
	dsp << "SOURCE=\"$(InputPath)\"" << std::endl;
	dsp << "PostBuild_Desc=Installing library and API headers..." << std::endl;
	dsp << "PostBuild_Cmds=call install_" << project.libname.c_str() << ".bat\t";
//	dsp << "copy ..\\Release\\" << project.libname.c_str() << ".lib \"" << output_lib_dir.c_str() << "\"";

	// create the install_libname.bat installation batch file:
	{
		CString bat_file = "Sources\\install_";
		bat_file += project.libname.c_str();
		bat_file += ".bat";

		std::ofstream bat(bat_file);

		CString instdir = workspace.output_include_dir.c_str();
		instdir += "\\ClanLib";
		install_mkdir(bat, "API\\", std::string(instdir), &project);
		install_copydir(bat, "API\\", std::string(instdir), &project);
	}

	dsp << std::endl;
	dsp << "# End Special Build Tool" << std::endl;

	dsp << std::endl;
	dsp << "!ELSEIF  \"$(CFG)\" == \"" << project.libname.c_str() << " - Win32 Debug\"" << std::endl;
	dsp << std::endl;
	dsp << "# PROP BASE Use_MFC 0" << std::endl;
	dsp << "# PROP BASE Use_Debug_Libraries 1" << std::endl;
	dsp << "# PROP BASE Output_Dir \"../Debug\"" << std::endl;
	dsp << "# PROP BASE Intermediate_Dir \"../Debug/" << project.libname.c_str() << "\"" << std::endl;
	dsp << "# PROP BASE Target_Dir \"\"" << std::endl;
	dsp << "# PROP Use_MFC 0" << std::endl;
	dsp << "# PROP Use_Debug_Libraries 1" << std::endl;
	dsp << "# PROP Output_Dir \"../Debug\"" << std::endl;
	dsp << "# PROP Intermediate_Dir \"../Debug/" << project.libname.c_str() << "\"" << std::endl;
	dsp << "# PROP Target_Dir \"\"" << std::endl;
	dsp << "# ADD BASE CPP /MTd /nologo /W3 /Gm /GR /GX /Zi /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\"";
	if (project.name == "Core") // use precomp headers in clanCore.
		dsp << " /Yu\"Core\\precomp.h\" /FD /GZ /c" << std::endl;
	else if (project.name == "GUI") // use precomp headers in clanCore.
		dsp << " /Yu\"precomp.h\" /FD /GZ /c" << std::endl;
	else if (project.name == "Display")
		dsp << " /Yu\"Display\\display_precomp.h\" /FD /GZ /c" << std::endl;
	else
		dsp << " /YX /FD /GZ /c" << std::endl;


	dsp << "# ADD CPP /nologo /MTd /W3 /Gm /GR /GX /Zi /Od /I \".\"";
	if (!workspace.input_include_dir.empty()) dsp << " /I \"" << workspace.input_include_dir.c_str() << "\"";
	dsp << " /D \"NDEBUG\" /D \"WIN32\" /D \"_WINDOWS\"";

	{
		for (
			std::list<std::string>::const_iterator it = project.defines_list.begin();
			it != project.defines_list.end();
			it++)
		{
			dsp << " /D \"" << (*it).c_str() << "\"";
		}
	}
	if (project.name == "Core") // use precomp headers in clanCore.
		dsp << " /Yu\"Core\\precomp.h\" /FD /GZ /c" << std::endl;
	else if (project.name == "GUI") // use precomp headers in clanGUI.
		dsp << " /Yu\"precomp.h\" /FD /GZ /c" << std::endl;
	if (project.name == "Display") // use precomp headers in clanDisplay.
		dsp << " /Yu\"Display\\display_precomp.h\" /FD /GZ /c" << std::endl;
	else
		dsp << " /YX /FD /GZ /c" << std::endl;

	dsp << "# ADD BASE RSC /l 0x409 /d \"_DEBUG\"" << std::endl;
	dsp << "# ADD RSC /l 0x409 /d \"_DEBUG\"" << std::endl;
	dsp << "BSC32=bscmake.exe" << std::endl;
	dsp << "# ADD BASE BSC32 /nologo" << std::endl;
	dsp << "# ADD BSC32 /nologo" << std::endl;
	dsp << "LIB32=link.exe -lib" << std::endl;
	dsp << "# ADD BASE LIB32 /nologo";
	if (!workspace.input_lib_dir.empty()) dsp << " /libpath:\"" << workspace.input_lib_dir.c_str() << "\"";
	dsp << std::endl;

	dsp << "# ADD LIB32 ";
	{
		for (
			std::list<std::string>::const_iterator it = project.libs_shared.begin();
			it != project.libs_shared.end();
			it++)
		{
			dsp << " " << (*it).c_str() << "";
		}
	}
	{
		for (
			std::list<std::string>::const_iterator it = project.libs_debug.begin();
			it != project.libs_debug.end();
			it++)
		{
			dsp << " " << (*it).c_str() << "";
		}
	}
//	dsp << " /nologo /out:\"../Debug/" << project.libname.c_str() << "d.lib\"" << std::endl;
	dsp << " /nologo /out:\"" << workspace.output_lib_dir.c_str() << "\\" << project.libname.c_str() << "d.lib\"" << std::endl;

	dsp << "# Begin Special Build Tool" << std::endl;
	dsp << "SOURCE=\"$(InputPath)\"" << std::endl;
	dsp << "PostBuild_Desc=Installing library and API headers..." << std::endl;
	dsp << "PostBuild_Cmds=call install_" << project.libname.c_str() << ".bat\t";

//	dsp << "copy ..\\Debug\\" << project.libname.c_str() << "d.lib \"" << workspace.output_lib_dir.c_str() << "\"";

	dsp << std::endl;
	dsp << "# End Special Build Tool" << std::endl;

	dsp << std::endl;
	dsp << "!ENDIF " << std::endl;
	dsp << std::endl;
	dsp << "# Begin Target" << std::endl;
	dsp << std::endl;
	dsp << "# Name \"" << project.libname.c_str() << " - Win32 Release\"" << std::endl;
	dsp << "# Name \"" << project.libname.c_str() << " - Win32 Debug\"" << std::endl;

	// Generate list of source files:
	generate_source_files(dsp, project);

	// End .dsp file:
	dsp << "# End Target" << std::endl;
	dsp << "# End Project" << std::endl;
}

void WorkspaceGenerator_MSVC6::generate_source_files(std::ofstream &dsp, const Project &project)
{
	std::string chop_str = "Sources\\";
	unsigned int chop_length = chop_str.length();

	std::list<std::string>::iterator itCur, itNew;
	std::list<std::string> cur_path;

	std::list<std::string>::const_iterator itFiles;
	for (itFiles = project.files.begin(); itFiles != project.files.end(); itFiles++)
	{
		std::string file = *itFiles;

		// cut off path to files:
		if (file.length() > chop_length && file.substr(0, chop_length) == chop_str)
		{
			file = file.substr(chop_length);
		}

		std::list<std::string> new_path = extract_path(file);

		itCur = cur_path.begin();
		itNew = new_path.begin();
		while (itCur != cur_path.end())
		{
			if (itNew == new_path.end() || *itCur != *itNew) // path is no longer identical
			{
				while (itCur != cur_path.end())
				{
					end_group(dsp);
					itCur++;
				}
				break;
			}

			itCur++;
			itNew++;
		}
		while (itNew != new_path.end())
		{
			if (file.find("API") == std::string::npos) begin_group(dsp, *itNew + " files");
			else begin_group(dsp, *itNew);
			itNew++;
		}

		cur_path = new_path;

		add_file(dsp, file);
	}

	for (itCur = cur_path.begin(); itCur != cur_path.end(); itCur++) end_group(dsp);
}

std::list<std::string> WorkspaceGenerator_MSVC6::extract_path(const std::string &fullname)
{
	std::list<std::string> path;
	int pos = 0;
	int old_pos = 0;

	while (true)
	{
		int pos = fullname.find("\\", old_pos);
		if (pos == std::string::npos) break;

		path.push_back(fullname.substr(old_pos, pos-old_pos));

		old_pos = pos + 1;
	}

	return path;
}

void WorkspaceGenerator_MSVC6::begin_group(std::ofstream &dsp, const std::string &group_name)
{
	dsp << "# Begin Group \"" << group_name.c_str() << "\"" << std::endl;
	dsp << std::endl;
	dsp << "# PROP Default_Filter \"\"" << std::endl;
}

void WorkspaceGenerator_MSVC6::end_group(std::ofstream &dsp)
{
	dsp << "# End Group" << std::endl;
}

void WorkspaceGenerator_MSVC6::add_file(std::ofstream &dsp, const std::string &filename)
{
	dsp << "# Begin Source File" << std::endl;
	dsp << std::endl;
	dsp << "SOURCE=" << filename.c_str() << std::endl;

	if (filename == "Core\\precomp.cpp")
	{
		dsp << "# ADD CPP /Yc\"Core\\precomp.h\"" << std::endl;
	}
	else if (filename == "Display\\display_precomp.cpp")
	{
		dsp << "# ADD CPP /Yc\"Display\\display_precomp.h\"" << std::endl;
	}
	else if (filename == "GUI\\precomp.cpp")
	{
		dsp << "# ADD CPP /Yc\"precomp.h\"" << std::endl;
	}

	dsp << "# End Source File" << std::endl;
}

void WorkspaceGenerator_MSVC6::install_mkdir(
	std::ofstream &dsp,
	const std::string &src_dir,
	const std::string &dest_dir,
	const Project *project)
{
	static OSVERSIONINFO versionInfo;
	static firstCall = true;
	if (firstCall)
	{
		memset(&versionInfo, 0, sizeof(OSVERSIONINFO));
		GetVersionEx(&versionInfo);
		firstCall = false;
	}

	bool win9x = (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);

	if (win9x)
	{
		dsp << "if not exist \"" << dest_dir << "\\nul\"" << " mkdir \"" << dest_dir << "\"" << std::endl;
	}
	else
	{
		dsp << "if not exist \"" << dest_dir << "\"" << " mkdir \"" << dest_dir << "\"" << std::endl;
	}

	CString path = src_dir.c_str();
	if (path.GetAt(path.GetLength() - 1) != '\\')
		path += '\\';

	CString path_dest = dest_dir.c_str();
	if (path_dest.GetAt(path_dest.GetLength() - 1) != '\\')
		path_dest += '\\';

	if (project)
	{
		// first time call: 
		// - make sure we create Module specific directories

		path = path + project->name.c_str();
		if (path.GetAt(path.GetLength() - 1) != '\\')
			path += '\\';

		path_dest = path_dest + project->name.c_str();
		if (win9x)
		{
			dsp << "if not exist \"" << std::string(path_dest) << "\\nul\"" << " mkdir \"" << std::string(path_dest) << "\"" << std::endl;
		}
		else
		{
			dsp << "if not exist \"" << std::string(path_dest) << "\"" << " mkdir \"" << std::string(path_dest) << "\"" << std::endl;
		}

		if (path_dest.GetAt(path_dest.GetLength() - 1) != '\\')
			path_dest += '\\';
	}

	CString prefix = "Sources\\";

	WIN32_FIND_DATA	data;
	HANDLE handle = FindFirstFile(prefix + path + "*.*", &data);
	if (handle == INVALID_HANDLE_VALUE) return;

	static const char *exclude_from_build[] =
	{
		".",
		"..",
		"CVS",
		".#", // don't add CVS revision backups.
		NULL
	};

	do
	{
		bool skip = false;

		for (int i=0; exclude_from_build[i] != NULL; i++)
			if (stricmp(data.cFileName, exclude_from_build[i]) == 0) skip = true;

		if (skip) continue;

		if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
		{
			CString subdir = data.cFileName;
			install_mkdir(
				dsp,
				std::string(path + subdir),
				std::string(path_dest + subdir),
				0);
		}
	} while (FindNextFile(handle, &data));
}

void WorkspaceGenerator_MSVC6::install_copydir(
	std::ofstream &dsp,
	const std::string &src_dir,
	const std::string &dest_dir,
	const Project *project)
{
	CString path = src_dir.c_str();
	if (path.GetAt(path.GetLength() - 1) != '\\')
		path += '\\';

	CString path_dest = dest_dir.c_str();
	if (path_dest.GetAt(path_dest.GetLength() - 1) != '\\')
		path_dest += '\\';

	if (project)
	{
		// first time call: 
		// - make sure we copy the 'module' api header
		// - make sure we get API\\ModuleName\*.h in this run

		dsp << "copy \"" << LPCTSTR (path) << LPCTSTR (project->headername.c_str()) << "\" \"" << LPCTSTR (path_dest) << LPCTSTR (project->headername.c_str()) << "\" > nul" << std::endl; // "\"\t";

		path += project->name.c_str();
		if (path.GetAt(path.GetLength() - 1) != '\\') path += '\\';
		
		path_dest += project->name.c_str();
		if (path_dest.GetAt(path_dest.GetLength() - 1) != '\\') path_dest += '\\';

	}

	CString prefix = "Sources\\";

	WIN32_FIND_DATA	data;
	HANDLE handle = FindFirstFile(prefix + path + "*.*", &data);
	if (handle == INVALID_HANDLE_VALUE) return;

	static const char *exclude_from_build[] =
	{
		".",
		"..",
		"CVS",
		".#", // don't add CVS revision backups.
		NULL
	};

	do
	{
		bool skip = false;

		for (int i=0; exclude_from_build[i] != NULL; i++)
			if (stricmp(data.cFileName, exclude_from_build[i]) == 0) skip = true;

		if (skip) continue;

		if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)
		{
			CString subdir = data.cFileName;
			install_copydir(
				dsp,
				std::string(path + subdir),
				std::string(path_dest + subdir),
				0);
		}
		else
		{
			CString file = data.cFileName;
			dsp << "copy \"" << LPCTSTR (path) << LPCTSTR (file) << "\" \"" << LPCTSTR (path_dest) << LPCTSTR (file) << "\" > nul" << std::endl; // "\"\t";
		}

	} while (FindNextFile(handle, &data));
}

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC7 construction:

WorkspaceGenerator_MSVC7::WorkspaceGenerator_MSVC7()
{
}

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC7 attributes:

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC7 operations:

void WorkspaceGenerator_MSVC7::write(const Workspace &param_workspace)
{
	workspace = param_workspace;

	std::ofstream sln("ClanLib.sln");

	sln << "Microsoft Visual Studio Solution File, Format Version 7.00" << std::endl;

	// Write sln project:

	std::string vcproj_path(".\\Sources\\");
	std::vector<std::string> projectGUIDs;

	std::list<Project>::const_iterator itProject;
	for (itProject = workspace.projects.begin(); itProject != workspace.projects.end(); itProject++)
	{
		const Project &project = *itProject;
		projectGUIDs.push_back(write_project(sln, project, vcproj_path));
/*
		begin_project(dsw, project.libname, dsp_path+project.libname+std::string(".dsp"));

		std::list<std::string>::const_iterator it;
		for (it = project.dependencies.begin(); it != project.dependencies.end(); it++)
		{
			const std::string &dep = *it;
			add_project_dependency(dsw, dep);
		}

		end_project(dsw);
*/
	}

	sln << "Global" << std::endl;
	sln << "	GlobalSection(SolutionConfiguration) = preSolution" << std::endl;
	sln << "		ConfigName.0 = Debug" << std::endl;
	sln << "		ConfigName.1 = Release" << std::endl;
	sln << "	EndGlobalSection" << std::endl;
	sln << "	GlobalSection(ProjectDependencies) = postSolution" << std::endl;
	sln << "	EndGlobalSection" << std::endl;
	sln << "	GlobalSection(ProjectConfiguration) = postSolution" << std::endl;
	for (std::vector<std::string>::size_type i=0; i<projectGUIDs.size(); i++)
	{
		sln << "		" << projectGUIDs[i].c_str() << ".Debug.ActiveCfg = Debug|Win32" << std::endl;
		sln << "		" << projectGUIDs[i].c_str() << ".Debug.Build.0 = Debug|Win32" << std::endl;
		sln << "		" << projectGUIDs[i].c_str() << ".Release.ActiveCfg = Release|Win32" << std::endl;
		sln << "		" << projectGUIDs[i].c_str() << ".Release.Build.0 = Release|Win32" << std::endl;
	}
	sln << "	EndGlobalSection" << std::endl;
	sln << "	GlobalSection(ExtensibilityGlobals) = postSolution" << std::endl;
	sln << "	EndGlobalSection" << std::endl;
	sln << "	GlobalSection(ExtensibilityAddIns) = postSolution" << std::endl;
	sln << "	EndGlobalSection" << std::endl;
	sln << "EndGlobal" << std::endl;
}

/////////////////////////////////////////////////////////////////////////////
// WorkspaceGenerator_MSVC7 implementation:

std::string WorkspaceGenerator_MSVC7::get_project_guid(const std::string &project)
{
	std::string returnGUID;

	// Check if we already made a GUID earlier. Reuse it if we did.
	LONG result;
	HKEY key = 0;
	result = RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Clansoft\\ClanLib\\ProjectGUIDs", &key);
	if (result != ERROR_SUCCESS)
		key = 0;
	if (key)
	{
		DWORD type = 0, needed = 0;
		result = RegQueryValueEx(key, project.c_str(), 0, &type, 0, &needed);
		if (result == ERROR_SUCCESS && type == REG_SZ)
		{
			char *buffer = new char[needed];
			result = RegQueryValueEx(key, project.c_str(), 0, &type, (LPBYTE) buffer, &needed);
			if (result == ERROR_SUCCESS)
			{
				returnGUID = buffer;
				delete[] buffer;
				RegCloseKey(key);
				return returnGUID;
			}
			delete[] buffer;
		}
	}

	// Create a new GUID:
	unsigned char *projectGUID = 0;
	GUID guid;
	UuidCreate(&guid);
	UuidToString(&guid, &projectGUID);
	_strupr((char *) projectGUID);
	returnGUID = std::string("{") + ((char *) projectGUID) + std::string("}");
	RpcStringFree(&projectGUID);

	// Save it to registry:
	if (key)
	{
		result = RegSetValueEx(
			key,
			project.c_str(),
			0,
			REG_SZ,
			(LPBYTE) returnGUID.c_str(),
			returnGUID.length()+1);
		RegCloseKey(key);
	}

	return returnGUID;
}

std::string WorkspaceGenerator_MSVC7::write_project(std::ofstream &sln, const Project &project, const std::string &vcproj_path)
{
	// Write sln project:
	std::string projectName = project.libname;
	std::string projectFilename = vcproj_path + project.libname + ".vcproj";
	std::string returnGUID = get_project_guid(projectName);

	sln << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" << projectName.c_str() << "\", \"" << projectFilename.c_str() << "\", \"" << returnGUID.c_str() << "\"\r\n";
	sln << "EndProject\r\n";

	// Write vcproj file:
	std::string includePath = ".";
	if (!workspace.input_include_dir.empty()) includePath += "," + workspace.input_include_dir;

	std::string defines = "NDEBUG,WIN32,_WINDOWS";
	std::list<std::string>::const_iterator it;
	for (it = project.defines_list.begin(); it != project.defines_list.end(); ++it)
	{
		defines += "," + (*it);
	}

	std::string precompiledHeaderThrough;
	std::string precompiledHeaderFileDebug;
	std::string precompiledHeaderFileRelease;
	std::string assemblerListingLocationDebug = ".\\../Debug/"+projectName+"/";
	std::string assemblerListingLocationRelease = ".\\../Release/"+projectName+"/";
	std::string objectFileDebug = ".\\../Debug/"+projectName+"/";
	std::string objectFileRelease = ".\\../Release/"+projectName+"/";
	std::string programDataBaseFileNameDebug = ".\\../Debug/"+projectName+"/";
	std::string programDataBaseFileNameRelease = ".\\../Release/"+projectName+"/";
	std::string additionalOptionsDebug;
	std::string additionalOptionsRelease;
	std::string outputFileDebug = workspace.output_lib_dir + "\\" + project.libname + "d.lib";
	std::string outputFileRelease = workspace.output_lib_dir + "\\" + project.libname + ".lib";
	std::string commandLine = "call install_" + project.libname + ".bat";

	if (project.name == "Core") // use precomp headers in clanCore.
	{
		precompiledHeaderThrough = "Core\\precomp.h";
		precompiledHeaderFileDebug = ".\\../Debug/"+projectName+"/"+projectName+".pch";
		precompiledHeaderFileRelease = ".\\../Release/"+projectName+"/"+projectName+".pch";
	}
	if (project.name == "Sound") // use precomp headers in clanSound.
	{
		precompiledHeaderThrough = "Sound\\precomp.h";
		precompiledHeaderFileDebug = ".\\../Debug/"+projectName+"/"+projectName+".pch";
		precompiledHeaderFileRelease = ".\\../Release/"+projectName+"/"+projectName+".pch";
	}
	else if (project.name == "GUI") // use precomp headers in clanGUI.
	{
		precompiledHeaderThrough = "precomp.h";
		precompiledHeaderFileDebug = ".\\../Debug/"+projectName+"/"+projectName+".pch";
		precompiledHeaderFileRelease = ".\\../Release/"+projectName+"/"+projectName+".pch";
	}
	else if (project.name == "Display") // use precomp headers in clanDisplay.
	{
		precompiledHeaderThrough = "Display\\display_precomp.h";
		precompiledHeaderFileDebug = ".\\../Debug/"+projectName+"/"+projectName+".pch";
		precompiledHeaderFileRelease = ".\\../Release/"+projectName+"/"+projectName+".pch";
	}

	{
		for (
			std::list<std::string>::const_iterator it = project.libs_shared.begin();
			it != project.libs_shared.end();
			it++)
		{
			additionalOptionsDebug += (*it) + " ";
			additionalOptionsRelease += (*it) + " ";
		}
	}
	{
		for (
			std::list<std::string>::const_iterator it = project.libs_debug.begin();
			it != project.libs_debug.end();
			it++)
		{
			additionalOptionsDebug += (*it) + " ";
		}
	}
	{
		for (
			std::list<std::string>::const_iterator it = project.libs_release.begin();
			it != project.libs_release.end();
			it++)
		{
			additionalOptionsRelease += (*it) + " ";
		}
	}

	std::ofstream vcproj(projectFilename.c_str());
	vcproj << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>" << std::endl;
	vcproj << "<VisualStudioProject" << std::endl;
	vcproj << "	ProjectType=\"Visual C++\"" << std::endl;
	vcproj << "	Version=\"7.00\"" << std::endl;
	vcproj << "	Name=\"" << project.libname.c_str() << "\"" << std::endl;
	vcproj << "	SccProjectName=\"\"" << std::endl;
	vcproj << "	SccLocalPath=\"\">" << std::endl;
	vcproj << "	<Platforms>" << std::endl;
	vcproj << "		<Platform" << std::endl;
	vcproj << "			Name=\"Win32\"/>" << std::endl;
	vcproj << "	</Platforms>" << std::endl;
	vcproj << "	<Configurations>" << std::endl;
	vcproj << "		<Configuration" << std::endl;
	vcproj << "			Name=\"Debug|Win32\"" << std::endl;
	vcproj << "			OutputDirectory=\".\\../Debug\"" << std::endl;
	vcproj << "			IntermediateDirectory=\".\\../Debug/" << project.libname.c_str() << "\"" << std::endl;
	vcproj << "			ConfigurationType=\"4\"" << std::endl;
	vcproj << "			UseOfMFC=\"0\"" << std::endl;
	vcproj << "			ATLMinimizesCRunTimeLibraryUsage=\"FALSE\">" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCCLCompilerTool\"" << std::endl;
	vcproj << "				Optimization=\"0\"" << std::endl;
	vcproj << "				AdditionalIncludeDirectories=\"" << includePath.c_str() << "\"" << std::endl;
	vcproj << "				PreprocessorDefinitions=\"" << defines.c_str() << "\"" << std::endl;
	vcproj << "				BasicRuntimeChecks=\"3\"" << std::endl;
	vcproj << "				RuntimeLibrary=\"1\"" << std::endl;
	vcproj << "				RuntimeTypeInfo=\"TRUE\"" << std::endl;
	if (precompiledHeaderThrough.empty())
	{
		vcproj << "				UsePrecompiledHeader=\"2\"" << std::endl;
	}
	else
	{
		vcproj << "				UsePrecompiledHeader=\"3\"" << std::endl;
		vcproj << "				PrecompiledHeaderThrough=\"" << precompiledHeaderThrough.c_str() << "\"" << std::endl;
		vcproj << "				PrecompiledHeaderFile=\"" << precompiledHeaderFileDebug.c_str() << "\"" << std::endl;
	}
	vcproj << "				AssemblerListingLocation=\"" << assemblerListingLocationDebug.c_str() << "\"" << std::endl;
	vcproj << "				ObjectFile=\"" << objectFileDebug.c_str() << "\"" << std::endl;
	vcproj << "				ProgramDataBaseFileName=\"" << programDataBaseFileNameDebug.c_str() << "\"" << std::endl;
	vcproj << "				WarningLevel=\"3\"" << std::endl;
	vcproj << "				SuppressStartupBanner=\"TRUE\"" << std::endl;
	vcproj << "				DebugInformationFormat=\"3\"" << std::endl;
	vcproj << "				CompileAs=\"0\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCCustomBuildTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCLibrarianTool\"" << std::endl;
	vcproj << "				AdditionalOptions=\"" << additionalOptionsDebug.c_str() << "\"" << std::endl;
	vcproj << "				OutputFile=\"" << outputFileDebug.c_str() << "\"" << std::endl;
	vcproj << "				SuppressStartupBanner=\"TRUE\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCMIDLTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCPostBuildEventTool\"" << std::endl;
	vcproj << "				Description=\"Installing library and API headers...\"" << std::endl;
	vcproj << "				CommandLine=\"" << commandLine.c_str() << "\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCPreBuildEventTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCPreLinkEventTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCResourceCompilerTool\"" << std::endl;
	vcproj << "				PreprocessorDefinitions=\"_DEBUG\"" << std::endl;
	vcproj << "				Culture=\"1033\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCWebServiceProxyGeneratorTool\"/>" << std::endl;
	vcproj << "		</Configuration>" << std::endl;
	vcproj << "		<Configuration" << std::endl;
	vcproj << "			Name=\"Release|Win32\"" << std::endl;
	vcproj << "			OutputDirectory=\".\\../Release\"" << std::endl;
	vcproj << "			IntermediateDirectory=\".\\../Release/" << project.libname.c_str() << "\"" << std::endl;
	vcproj << "			ConfigurationType=\"4\"" << std::endl;
	vcproj << "			UseOfMFC=\"0\"" << std::endl;
	vcproj << "			ATLMinimizesCRunTimeLibraryUsage=\"FALSE\">" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCCLCompilerTool\"" << std::endl;
	vcproj << "				InlineFunctionExpansion=\"1\"" << std::endl;
	vcproj << "				AdditionalIncludeDirectories=\"" << includePath.c_str() << "\"" << std::endl;
	vcproj << "				PreprocessorDefinitions=\"" << defines.c_str() << "\"" << std::endl;
	vcproj << "				StringPooling=\"TRUE\"" << std::endl;
	vcproj << "				RuntimeLibrary=\"0\"" << std::endl;
	vcproj << "				EnableFunctionLevelLinking=\"TRUE\"" << std::endl;
	vcproj << "				RuntimeTypeInfo=\"TRUE\"" << std::endl;
	if (precompiledHeaderThrough.empty())
	{
		vcproj << "				UsePrecompiledHeader=\"2\"" << std::endl;
	}
	else
	{
		vcproj << "				UsePrecompiledHeader=\"3\"" << std::endl;
		vcproj << "				PrecompiledHeaderThrough=\"" << precompiledHeaderThrough.c_str() << "\"" << std::endl;
		vcproj << "				PrecompiledHeaderFile=\"" << precompiledHeaderFileRelease.c_str() << "\"" << std::endl;
	}
	vcproj << "				AssemblerListingLocation=\"" << assemblerListingLocationRelease.c_str() << "\"" << std::endl;
	vcproj << "				ObjectFile=\"" << objectFileRelease.c_str() << "\"" << std::endl;
	vcproj << "				ProgramDataBaseFileName=\"" << programDataBaseFileNameRelease.c_str() << "\"" << std::endl;
	vcproj << "				WarningLevel=\"3\"" << std::endl;
	vcproj << "				SuppressStartupBanner=\"TRUE\"" << std::endl;
	vcproj << "				DebugInformationFormat=\"3\"" << std::endl;
	vcproj << "				CompileAs=\"0\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCCustomBuildTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCLibrarianTool\"" << std::endl;
	vcproj << "				AdditionalOptions=\"" << additionalOptionsRelease.c_str() << "\"" << std::endl;
	vcproj << "				OutputFile=\"" << outputFileRelease.c_str() << "\"" << std::endl;
	vcproj << "				SuppressStartupBanner=\"TRUE\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCMIDLTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCPostBuildEventTool\"" << std::endl;
	vcproj << "				Description=\"Installing library and API headers...\"" << std::endl;
	vcproj << "				CommandLine=\"" << commandLine.c_str() << "\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCPreBuildEventTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCPreLinkEventTool\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCResourceCompilerTool\"" << std::endl;
	vcproj << "				PreprocessorDefinitions=\"NDEBUG\"" << std::endl;
	vcproj << "				Culture=\"1033\"/>" << std::endl;
	vcproj << "			<Tool" << std::endl;
	vcproj << "				Name=\"VCWebServiceProxyGeneratorTool\"/>" << std::endl;
	vcproj << "		</Configuration>" << std::endl;
	vcproj << "	</Configurations>" << std::endl;
	vcproj << "	<Files>" << std::endl;

	generate_source_files(vcproj, project);

	vcproj << "	</Files>" << std::endl;
	vcproj << "	<Globals>" << std::endl;
	vcproj << "	</Globals>" << std::endl;
	vcproj << "</VisualStudioProject>" << std::endl;

	return returnGUID;
}

void WorkspaceGenerator_MSVC7::generate_source_files(std::ofstream &vcproj, const Project &project)
{
	std::string chop_str = "Sources\\";
	unsigned int chop_length = chop_str.length();

	std::list<std::string>::iterator itCur, itNew;
	std::list<std::string> cur_path;

	std::list<std::string>::const_iterator itFiles;
	for (itFiles = project.files.begin(); itFiles != project.files.end(); itFiles++)
	{
		std::string file = *itFiles;

		// cut off path to files:
		if (file.length() > chop_length && file.substr(0, chop_length) == chop_str)
		{
			file = file.substr(chop_length);
		}

		std::list<std::string> new_path = extract_path(file);

		itCur = cur_path.begin();
		itNew = new_path.begin();
		while (itCur != cur_path.end())
		{
			if (itNew == new_path.end() || *itCur != *itNew) // path is no longer identical
			{
				while (itCur != cur_path.end())
				{
					end_group(vcproj);
					itCur++;
				}
				break;
			}

			itCur++;
			itNew++;
		}
		while (itNew != new_path.end())
		{
			if (file.find("API") == std::string::npos) begin_group(vcproj, *itNew + " files");
			else begin_group(vcproj, *itNew);
			itNew++;
		}

		cur_path = new_path;

		add_file(vcproj, file);
	}

	for (itCur = cur_path.begin(); itCur != cur_path.end(); itCur++) end_group(vcproj);
}

std::list<std::string> WorkspaceGenerator_MSVC7::extract_path(const std::string &fullname)
{
	std::list<std::string> path;
	int pos = 0;
	int old_pos = 0;

	while (true)
	{
		int pos = fullname.find("\\", old_pos);
		if (pos == std::string::npos) break;

		path.push_back(fullname.substr(old_pos, pos-old_pos));

		old_pos = pos + 1;
	}

	return path;
}

void WorkspaceGenerator_MSVC7::begin_group(std::ofstream &vcproj, const std::string &group_name)
{
	vcproj << "		<Filter" << std::endl;
	vcproj << "			Name=\"" << group_name.c_str() << "\"" << std::endl;
	vcproj << "			Filter=\"\">" << std::endl;
}

void WorkspaceGenerator_MSVC7::end_group(std::ofstream &vcproj)
{
	vcproj << "		</Filter>" << std::endl;
}

void WorkspaceGenerator_MSVC7::add_file(std::ofstream &vcproj, const std::string &filename)
{
	vcproj << "			<File" << std::endl;
	vcproj << "				RelativePath=\"" << filename.c_str() << "\">" << std::endl;

	if (
		filename == "Core\\precomp.cpp" ||
		filename == "Sound\\precomp.cpp" ||
		filename == "Display\\display_precomp.cpp" ||
		filename == "GUI\\precomp.cpp")
	{
		vcproj << "				<FileConfiguration" << std::endl;
		vcproj << "					Name=\"Debug|Win32\">" << std::endl;
		vcproj << "					<Tool" << std::endl;
		vcproj << "						Name=\"VCCLCompilerTool\"" << std::endl;
		vcproj << "						UsePrecompiledHeader=\"1\"/>" << std::endl;
		vcproj << "				</FileConfiguration>" << std::endl;
		vcproj << "				<FileConfiguration" << std::endl;
		vcproj << "					Name=\"Release|Win32\">" << std::endl;
		vcproj << "					<Tool" << std::endl;
		vcproj << "						Name=\"VCCLCompilerTool\"" << std::endl;
		vcproj << "						UsePrecompiledHeader=\"1\"/>" << std::endl;
		vcproj << "				</FileConfiguration>" << std::endl;
	}

	vcproj << "			</File>" << std::endl;
}
