* make intermediate / outpath optional

* if u want to continue using vc specific path / configuration add flag -vo{version|configuration}

svn path=/trunk/; revision=22503
This commit is contained in:
Johannes Anderwald 2006-06-22 18:50:00 +00:00
parent 7d91409d48
commit bbc1c1a111
4 changed files with 39 additions and 3 deletions

View file

@ -85,7 +85,9 @@ MSVCBackend::_generate_vcproj ( const Module& module )
string outenv = Environment::GetOutputPath ();
string outdir;
string intdir;
string vcdir;
if ( intenv == "obj-i386" )
intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */
else
@ -96,6 +98,10 @@ MSVCBackend::_generate_vcproj ( const Module& module )
else
outdir = outenv;
if ( configuration.UseVSVersionInPath )
{
vcdir = "\\" + _get_vc_dir();
}
// TODO FIXME - need more checks here for 'sys' and possibly 'drv'?
bool console = exe && (module.type == Win32CUI);
@ -220,8 +226,18 @@ MSVCBackend::_generate_vcproj ( const Module& module )
fprintf ( OUT, "\t\t<Configuration\r\n" );
fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() );
fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s\\%s\\%s\"\r\n", outdir.c_str (), module.GetBasePath ().c_str (), _get_vc_dir().c_str (), cfg.name.c_str() );
fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s\\%s\\%s\"\r\n", intdir.c_str (), module.GetBasePath ().c_str (), _get_vc_dir().c_str (), cfg.name.c_str() );
if ( configuration.UseVSConfigurationInPath )
{
fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n", outdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str (), cfg.name.c_str() );
fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n", intdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str (), cfg.name.c_str() );
}
else
{
fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\"\r\n", outdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str () );
fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\"\r\n", intdir.c_str (), module.GetBasePath ().c_str (), vcdir.c_str () );
}
fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", exe ? 1 : dll ? 2 : lib ? 4 : -1 );
fprintf ( OUT, "\t\t\tCharacterSet=\"2\">\r\n" );

View file

@ -30,6 +30,8 @@ Configuration::Configuration ()
MakeHandlesInstallDirectories = false;
GenerateProxyMakefilesInSourceTree = false;
InstallFiles = false;
UseVSConfigurationInPath = false;
UseVSVersionInPath = false;
}
Configuration::~Configuration ()

View file

@ -86,6 +86,8 @@ ParseVCProjectSwitch (
char switchChar2,
char* switchStart )
{
string temp;
switch ( switchChar2 )
{
case 's':
@ -112,6 +114,19 @@ ParseVCProjectSwitch (
configuration.VSConfigurationType = string (&switchStart[3]);
configuration.InstallFiles = true;
break;
case 'o':
if ( strlen ( switchStart ) <= 3 )
{
printf ( "Invalid switch\n" );
return false;
}
temp = string (&switchStart[3]);
if ( temp.find ("configuration") != string::npos )
configuration.UseVSConfigurationInPath = true;
if ( temp.find ("version") != string::npos )
configuration.UseVSVersionInPath = true;
break;
default:
printf ( "Unknown switch -d%c\n",
switchChar2 );
@ -238,6 +253,7 @@ main ( int argc, char** argv )
printf ( " -ps Generate proxy makefiles in source tree instead of the output.\n" );
printf ( " tree.\n" );
printf ( " -vs{version} Version of MS VS project files. Default is %s.\n", MS_VS_DEF_VERSION );
printf ( " -vo{version|configuration} Adds subdirectory path to the default Intermediate-Outputdirectory.\n" );
printf ( "\n" );
printf ( " buildsystem Target build system. Can be one of:\n" );

View file

@ -142,6 +142,8 @@ public:
std::string CheckDependenciesForModuleOnlyModule;
std::string VSProjectVersion;
std::string VSConfigurationType;
bool UseVSVersionInPath;
bool UseVSConfigurationInPath;
bool MakeHandlesInstallDirectories;
bool GenerateProxyMakefilesInSourceTree;
bool InstallFiles;