Support modules with no base install directory

svn path=/branches/xmlbuildsystem/; revision=15308
This commit is contained in:
Casper Hornstrup 2005-05-15 13:20:45 +00:00
parent 93b4d98160
commit dff44c9f17
3 changed files with 29 additions and 13 deletions

View file

@ -243,6 +243,7 @@ string
MingwBackend::AddDirectoryTarget ( const string& directory, MingwBackend::AddDirectoryTarget ( const string& directory,
Directory* directoryTree ) Directory* directoryTree )
{ {
if ( directory.length () > 0)
directoryTree->Add ( directory.c_str() ); directoryTree->Add ( directory.c_str() );
return directoryTree->name; return directoryTree->name;
} }
@ -775,7 +776,11 @@ MingwBackend::GetModuleInstallTargetFiles (
const Module& module = *ProjectNode.modules[i]; const Module& module = *ProjectNode.modules[i];
if ( module.installName.length () > 0 ) if ( module.installName.length () > 0 )
{ {
string targetFilenameNoFixup = module.installBase + SSEP + module.installName; string targetFilenameNoFixup;
if ( module.installBase.length () > 0 )
targetFilenameNoFixup = module.installBase + SSEP + module.installName;
else
targetFilenameNoFixup = module.installName;
string targetFilename = MingwModuleHandler::PassThruCacheDirectory ( string targetFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( targetFilenameNoFixup ), NormalizeFilename ( targetFilenameNoFixup ),
installDirectory ); installDirectory );
@ -797,8 +802,13 @@ MingwBackend::OutputInstallTarget ( const string& sourceFilename,
const string& targetFilename, const string& targetFilename,
const string& targetDirectory ) const string& targetDirectory )
{ {
string fullTargetFilename;
if ( targetDirectory.length () > 0)
fullTargetFilename = targetDirectory + SSEP + targetFilename;
else
fullTargetFilename = targetFilename;
string normalizedTargetFilename = MingwModuleHandler::PassThruCacheDirectory ( string normalizedTargetFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( targetDirectory + SSEP + targetFilename ), NormalizeFilename ( fullTargetFilename ),
installDirectory ); installDirectory );
string normalizedTargetDirectory = MingwModuleHandler::PassThruCacheDirectory ( string normalizedTargetDirectory = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( targetDirectory ), NormalizeFilename ( targetDirectory ),

View file

@ -110,8 +110,12 @@ MingwModuleHandler::PassThruCacheDirectory (
/* This path already includes the generated files directory variable */ /* This path already includes the generated files directory variable */
return file; return file;
else else
{
if ( file == "" )
return generatedFilesDirectory;
return generatedFilesDirectory + SSEP + file; return generatedFilesDirectory + SSEP + file;
} }
}
/*static*/ Directory* /*static*/ Directory*
MingwModuleHandler::GetTargetDirectoryTree ( MingwModuleHandler::GetTargetDirectoryTree (

View file

@ -73,7 +73,7 @@ GetDirectory ( const string& filename )
{ {
size_t index = filename.find_last_of ( CSEP ); size_t index = filename.find_last_of ( CSEP );
if ( index == string::npos ) if ( index == string::npos )
return filename; return "";
else else
return filename.substr ( 0, index ); return filename.substr ( 0, index );
} }
@ -81,6 +81,8 @@ GetDirectory ( const string& filename )
string string
NormalizeFilename ( const string& filename ) NormalizeFilename ( const string& filename )
{ {
if ( filename == "" )
return "";
Path path; Path path;
string normalizedPath = path.Fixup ( filename, true ); string normalizedPath = path.Fixup ( filename, true );
string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath ); string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath );