Merge topic 'clean-up-cmMakefile'

8dc3a67c cmMakefile: Out-of-line the directory methods.
0f3c8cfa cmMakefile: Use method abstraction to access directories.
b288a997 cmMakefile: Rename SetStart* directory API to SetCurrent*.
932d53bc cmMakefile: Remove redundant method duplication.
32b8f03a cmMakefile: Port users of GetStart* methods to new names.
54d6a918 cmMakefile: Rename GetCurrent{Output,Binary}Directory.
55d80d0a cmMakefile: Rename GetCurrent{,Source}Directory.
b23cf06f cmake: Remove redundant start directories.
fcf246ac cmMakefile: Populate Home directories on initialize.
8878bea7 cmake: Initialize Home directories on cmake for find-package mode.
044dc815 Use the Home directories from the cmake class where intended.
d67e8f24 cmake: Fix directory used to find the cache
1ea085d1 cmMakefile: Initialize dir definitions early.
f034bb2f Remove redundant calls to MakeStartDirectoriesCurrent.
3a68c323 cmMakefile: Fix wrong parameter names.
This commit is contained in:
Brad King 2015-04-21 09:42:07 -04:00 committed by CMake Topic Stage
commit 5a5ef00106
74 changed files with 360 additions and 434 deletions

View File

@ -346,10 +346,10 @@ void cmCTestScriptHandler::CreateCMake()
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
// Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR. // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR.
// Also, some commands need Makefile->GetCurrentDirectory(). // Also, some commands need Makefile->GetCurrentSourceDirectory().
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
this->Makefile->SetStartDirectory(cwd); this->Makefile->SetCurrentSourceDirectory(cwd);
this->Makefile->SetStartOutputDirectory(cwd); this->Makefile->SetCurrentBinaryDirectory(cwd);
// remove all cmake commands which are not scriptable, since they can't be // remove all cmake commands which are not scriptable, since they can't be
// used in ctest scripts // used in ctest scripts

View File

@ -144,9 +144,7 @@ void QCMake::configure()
#endif #endif
this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toLocal8Bit().data()); this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toLocal8Bit().data());
this->CMakeInstance->SetStartDirectory(this->SourceDirectory.toLocal8Bit().data());
this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toLocal8Bit().data()); this->CMakeInstance->SetHomeOutputDirectory(this->BinaryDirectory.toLocal8Bit().data());
this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toLocal8Bit().data());
this->CMakeInstance->SetGlobalGenerator( this->CMakeInstance->SetGlobalGenerator(
this->CMakeInstance->CreateGlobalGenerator(this->Generator.toLocal8Bit().data())); this->CMakeInstance->CreateGlobalGenerator(this->Generator.toLocal8Bit().data()));
this->CMakeInstance->SetGeneratorPlatform(""); this->CMakeInstance->SetGeneratorPlatform("");

View File

@ -168,7 +168,7 @@ bool cmAddCustomCommandCommand
// and later references "${CMAKE_CURRENT_SOURCE_DIR}/out.txt". // and later references "${CMAKE_CURRENT_SOURCE_DIR}/out.txt".
// This is fairly obscure so we can wait for someone to // This is fairly obscure so we can wait for someone to
// complain. // complain.
filename = this->Makefile->GetCurrentOutputDirectory(); filename = this->Makefile->GetCurrentBinaryDirectory();
filename += "/"; filename += "/";
} }
filename += copy; filename += copy;
@ -315,7 +315,7 @@ bool cmAddCustomCommandCommand
// Convert working directory to a full path. // Convert working directory to a full path.
if(!working.empty()) if(!working.empty())
{ {
const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); const char* build_dir = this->Makefile->GetCurrentBinaryDirectory();
working = cmSystemTools::CollapseFullPath(working, build_dir); working = cmSystemTools::CollapseFullPath(working, build_dir);
} }

View File

@ -138,7 +138,7 @@ bool cmAddCustomTargetCommand
std::string filename; std::string filename;
if (!cmSystemTools::FileIsFullPath(copy.c_str())) if (!cmSystemTools::FileIsFullPath(copy.c_str()))
{ {
filename = this->Makefile->GetCurrentOutputDirectory(); filename = this->Makefile->GetCurrentBinaryDirectory();
filename += "/"; filename += "/";
} }
filename += copy; filename += copy;
@ -240,7 +240,7 @@ bool cmAddCustomTargetCommand
// Convert working directory to a full path. // Convert working directory to a full path.
if(!working_directory.empty()) if(!working_directory.empty())
{ {
const char* build_dir = this->Makefile->GetCurrentOutputDirectory(); const char* build_dir = this->Makefile->GetCurrentBinaryDirectory();
working_directory = working_directory =
cmSystemTools::CollapseFullPath(working_directory, build_dir); cmSystemTools::CollapseFullPath(working_directory, build_dir);
} }

View File

@ -57,7 +57,7 @@ bool cmAddSubDirectoryCommand::InitialPass
} }
else else
{ {
srcPath = this->Makefile->GetCurrentDirectory(); srcPath = this->Makefile->GetCurrentSourceDirectory();
srcPath += "/"; srcPath += "/";
srcPath += srcArg; srcPath += srcArg;
} }
@ -79,12 +79,12 @@ bool cmAddSubDirectoryCommand::InitialPass
// not a subdirectory of the current directory then it is an // not a subdirectory of the current directory then it is an
// error. // error.
if(!cmSystemTools::IsSubDirectory(srcPath, if(!cmSystemTools::IsSubDirectory(srcPath,
this->Makefile->GetCurrentDirectory())) this->Makefile->GetCurrentSourceDirectory()))
{ {
std::ostringstream e; std::ostringstream e;
e << "not given a binary directory but the given source directory " e << "not given a binary directory but the given source directory "
<< "\"" << srcPath << "\" is not a subdirectory of \"" << "\"" << srcPath << "\" is not a subdirectory of \""
<< this->Makefile->GetCurrentDirectory() << "\". " << this->Makefile->GetCurrentSourceDirectory() << "\". "
<< "When specifying an out-of-tree source a binary directory " << "When specifying an out-of-tree source a binary directory "
<< "must be explicitly specified."; << "must be explicitly specified.";
this->SetError(e.str()); this->SetError(e.str());
@ -93,8 +93,8 @@ bool cmAddSubDirectoryCommand::InitialPass
// Remove the CurrentDirectory from the srcPath and replace it // Remove the CurrentDirectory from the srcPath and replace it
// with the CurrentOutputDirectory. // with the CurrentOutputDirectory.
const char* src = this->Makefile->GetCurrentDirectory(); const char* src = this->Makefile->GetCurrentSourceDirectory();
const char* bin = this->Makefile->GetCurrentOutputDirectory(); const char* bin = this->Makefile->GetCurrentBinaryDirectory();
size_t srcLen = strlen(src); size_t srcLen = strlen(src);
size_t binLen = strlen(bin); size_t binLen = strlen(bin);
if(srcLen > 0 && src[srcLen-1] == '/') if(srcLen > 0 && src[srcLen-1] == '/')
@ -113,7 +113,7 @@ bool cmAddSubDirectoryCommand::InitialPass
} }
else else
{ {
binPath = this->Makefile->GetCurrentOutputDirectory(); binPath = this->Makefile->GetCurrentBinaryDirectory();
binPath += "/"; binPath += "/";
binPath += binArg; binPath += binArg;
} }

View File

@ -29,7 +29,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass
std::string tdir; std::string tdir;
if(!cmSystemTools::FileIsFullPath(templateDirectory.c_str())) if(!cmSystemTools::FileIsFullPath(templateDirectory.c_str()))
{ {
tdir = this->Makefile->GetCurrentDirectory(); tdir = this->Makefile->GetCurrentSourceDirectory();
tdir += "/"; tdir += "/";
tdir += templateDirectory; tdir += templateDirectory;
} }

View File

@ -131,22 +131,22 @@ const char* CCONV cmGetHomeOutputDirectory(void *arg)
const char* CCONV cmGetStartDirectory(void *arg) const char* CCONV cmGetStartDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetStartDirectory(); return mf->GetCurrentSourceDirectory();
} }
const char* CCONV cmGetStartOutputDirectory(void *arg) const char* CCONV cmGetStartOutputDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetStartOutputDirectory(); return mf->GetCurrentBinaryDirectory();
} }
const char* CCONV cmGetCurrentDirectory(void *arg) const char* CCONV cmGetCurrentDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetCurrentDirectory(); return mf->GetCurrentSourceDirectory();
} }
const char* CCONV cmGetCurrentOutputDirectory(void *arg) const char* CCONV cmGetCurrentOutputDirectory(void *arg)
{ {
cmMakefile *mf = static_cast<cmMakefile *>(arg); cmMakefile *mf = static_cast<cmMakefile *>(arg);
return mf->GetCurrentOutputDirectory(); return mf->GetCurrentBinaryDirectory();
} }
const char* CCONV cmGetDefinition(void *arg,const char*def) const char* CCONV cmGetDefinition(void *arg,const char*def)
{ {

View File

@ -26,7 +26,7 @@ bool cmConfigureFileCommand
const char* inFile = args[0].c_str(); const char* inFile = args[0].c_str();
if(!cmSystemTools::FileIsFullPath(inFile)) if(!cmSystemTools::FileIsFullPath(inFile))
{ {
this->InputFile = this->Makefile->GetCurrentDirectory(); this->InputFile = this->Makefile->GetCurrentSourceDirectory();
this->InputFile += "/"; this->InputFile += "/";
} }
this->InputFile += inFile; this->InputFile += inFile;
@ -45,7 +45,7 @@ bool cmConfigureFileCommand
const char* outFile = args[1].c_str(); const char* outFile = args[1].c_str();
if(!cmSystemTools::FileIsFullPath(outFile)) if(!cmSystemTools::FileIsFullPath(outFile))
{ {
this->OutputFile = this->Makefile->GetCurrentOutputDirectory(); this->OutputFile = this->Makefile->GetCurrentBinaryDirectory();
this->OutputFile += "/"; this->OutputFile += "/";
} }
this->OutputFile += outFile; this->OutputFile += outFile;

View File

@ -73,7 +73,7 @@ bool cmCreateTestSourceList
"You must specify a file extension for the test driver file."); "You must specify a file extension for the test driver file.");
return false; return false;
} }
std::string driver = this->Makefile->GetCurrentOutputDirectory(); std::string driver = this->Makefile->GetCurrentBinaryDirectory();
driver += "/"; driver += "/";
driver += *i; driver += *i;
++i; ++i;

View File

@ -237,7 +237,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
else else
{ {
mod_dir = mod_dir =
this->LocalGenerator->GetMakefile()->GetCurrentOutputDirectory(); this->LocalGenerator->GetMakefile()->GetCurrentBinaryDirectory();
} }
// Actually write dependencies to the streams. // Actually write dependencies to the streams.

View File

@ -113,7 +113,7 @@ bool cmExportCommand
else else
{ {
// Interpret relative paths with respect to the current build dir. // Interpret relative paths with respect to the current build dir.
std::string dir = this->Makefile->GetCurrentOutputDirectory(); std::string dir = this->Makefile->GetCurrentBinaryDirectory();
fname = dir + "/" + fname; fname = dir + "/" + fname;
} }
@ -295,7 +295,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
// We store the current build directory in the registry as a value // We store the current build directory in the registry as a value
// named by a hash of its own content. This is deterministic and is // named by a hash of its own content. This is deterministic and is
// unique with high probability. // unique with high probability.
const char* outDir = this->Makefile->GetCurrentOutputDirectory(); const char* outDir = this->Makefile->GetCurrentBinaryDirectory();
std::string hash = cmSystemTools::ComputeStringMD5(outDir); std::string hash = cmSystemTools::ComputeStringMD5(outDir);
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__)
this->StorePackageRegistryWin(package, outDir, hash.c_str()); this->StorePackageRegistryWin(package, outDir, hash.c_str());

View File

@ -77,7 +77,7 @@ void cmExtraCodeBlocksGenerator::CreateProjectFile(
const std::vector<cmLocalGenerator*>& lgs) const std::vector<cmLocalGenerator*>& lgs)
{ {
const cmMakefile* mf=lgs[0]->GetMakefile(); const cmMakefile* mf=lgs[0]->GetMakefile();
std::string outputDir=mf->GetStartOutputDirectory(); std::string outputDir=mf->GetCurrentBinaryDirectory();
std::string projectName=mf->GetProjectName(); std::string projectName=mf->GetProjectName();
std::string filename=outputDir+"/"; std::string filename=outputDir+"/";
@ -331,7 +331,7 @@ void cmExtraCodeBlocksGenerator
{ {
// Only add the global targets from CMAKE_BINARY_DIR, // Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs // not from the subdirs
if (strcmp(makefile->GetStartOutputDirectory(), if (strcmp(makefile->GetCurrentBinaryDirectory(),
makefile->GetHomeOutputDirectory())==0) makefile->GetHomeOutputDirectory())==0)
{ {
this->AppendTarget(fout, ti->first, 0, this->AppendTarget(fout, ti->first, 0,
@ -524,7 +524,7 @@ std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
// this file doesn't seem to be used by C::B in custom makefile mode, // this file doesn't seem to be used by C::B in custom makefile mode,
// but we generate a unique file for each OBJECT library so in case // but we generate a unique file for each OBJECT library so in case
// C::B uses it in some way, the targets don't interfere with each other. // C::B uses it in some way, the targets don't interfere with each other.
std::string filename = mf->GetCurrentOutputDirectory(); std::string filename = mf->GetCurrentBinaryDirectory();
filename += "/"; filename += "/";
filename += mf->GetLocalGenerator()->GetTargetDirectory(*target); filename += mf->GetLocalGenerator()->GetTargetDirectory(*target);
filename += "/"; filename += "/";
@ -550,14 +550,14 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
const cmMakefile* makefile, const cmMakefile* makefile,
const char* compiler) const char* compiler)
{ {
std::string makefileName = makefile->GetStartOutputDirectory(); std::string makefileName = makefile->GetCurrentBinaryDirectory();
makefileName += "/Makefile"; makefileName += "/Makefile";
fout<<" <Target title=\"" << targetName << "\">\n"; fout<<" <Target title=\"" << targetName << "\">\n";
if (target!=0) if (target!=0)
{ {
int cbTargetType = this->GetCBTargetType(target); int cbTargetType = this->GetCBTargetType(target);
std::string workingDir = makefile->GetStartOutputDirectory(); std::string workingDir = makefile->GetCurrentBinaryDirectory();
if ( target->GetType()==cmTarget::EXECUTABLE) if ( target->GetType()==cmTarget::EXECUTABLE)
{ {
// Determine the directory where the executable target is created, and // Determine the directory where the executable target is created, and
@ -653,7 +653,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
else // e.g. all and the GLOBAL and UTILITY targets else // e.g. all and the GLOBAL and UTILITY targets
{ {
fout<<" <Option working_dir=\"" fout<<" <Option working_dir=\""
<< makefile->GetStartOutputDirectory() << "\" />\n" << makefile->GetCurrentBinaryDirectory() << "\" />\n"
<<" <Option type=\"" << 4 << "\" />\n"; <<" <Option type=\"" << 4 << "\" />\n";
} }

View File

@ -68,15 +68,15 @@ void cmExtraCodeLiteGenerator::Generate()
const cmMakefile* mf =it->second[0]->GetMakefile(); const cmMakefile* mf =it->second[0]->GetMakefile();
this->ConfigName = GetConfigurationName( mf ); this->ConfigName = GetConfigurationName( mf );
if (strcmp(mf->GetStartOutputDirectory(), if (strcmp(mf->GetCurrentBinaryDirectory(),
mf->GetHomeOutputDirectory()) == 0) mf->GetHomeOutputDirectory()) == 0)
{ {
workspaceOutputDir = mf->GetStartOutputDirectory(); workspaceOutputDir = mf->GetCurrentBinaryDirectory();
workspaceProjectName = mf->GetProjectName(); workspaceProjectName = mf->GetProjectName();
workspaceSourcePath = mf->GetHomeDirectory(); workspaceSourcePath = mf->GetHomeDirectory();
workspaceFileName = workspaceOutputDir+"/"; workspaceFileName = workspaceOutputDir+"/";
workspaceFileName += workspaceProjectName + ".workspace"; workspaceFileName += workspaceProjectName + ".workspace";
this->WorkspacePath = mf->GetStartOutputDirectory();; this->WorkspacePath = mf->GetCurrentBinaryDirectory();;
fout.Open(workspaceFileName.c_str(), false, false); fout.Open(workspaceFileName.c_str(), false, false);
fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
@ -92,7 +92,7 @@ void cmExtraCodeLiteGenerator::Generate()
{ {
// retrive project information // retrive project information
const cmMakefile* mf = it->second[0]->GetMakefile(); const cmMakefile* mf = it->second[0]->GetMakefile();
std::string outputDir = mf->GetStartOutputDirectory(); std::string outputDir = mf->GetCurrentBinaryDirectory();
std::string projectName = mf->GetProjectName(); std::string projectName = mf->GetProjectName();
std::string filename = outputDir + "/" + projectName + ".project"; std::string filename = outputDir + "/" + projectName + ".project";
@ -122,7 +122,7 @@ void cmExtraCodeLiteGenerator::CreateProjectFile(
const std::vector<cmLocalGenerator*>& lgs) const std::vector<cmLocalGenerator*>& lgs)
{ {
const cmMakefile* mf = lgs[0]->GetMakefile(); const cmMakefile* mf = lgs[0]->GetMakefile();
std::string outputDir = mf->GetStartOutputDirectory(); std::string outputDir = mf->GetCurrentBinaryDirectory();
std::string projectName = mf->GetProjectName(); std::string projectName = mf->GetProjectName();
std::string filename = outputDir + "/"; std::string filename = outputDir + "/";

View File

@ -495,7 +495,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
std::string sourceLinkedResourceName = "[Source directory]"; std::string sourceLinkedResourceName = "[Source directory]";
std::string linkSourceDirectory = this->GetEclipsePath( std::string linkSourceDirectory = this->GetEclipsePath(
mf->GetStartDirectory()); mf->GetCurrentSourceDirectory());
// .project dir can't be subdir of a linked resource dir // .project dir can't be subdir of a linked resource dir
if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory, if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
linkSourceDirectory)) linkSourceDirectory))
@ -633,7 +633,7 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
++it) ++it)
{ {
std::string linkSourceDirectory = this->GetEclipsePath( std::string linkSourceDirectory = this->GetEclipsePath(
it->second[0]->GetMakefile()->GetStartDirectory()); it->second[0]->GetMakefile()->GetCurrentSourceDirectory());
// a linked resource must not point to a parent directory of .project or // a linked resource must not point to a parent directory of .project or
// .project itself // .project itself
if ((baseDir != linkSourceDirectory) && if ((baseDir != linkSourceDirectory) &&
@ -1033,7 +1033,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{ {
const cmTargets& targets = (*it)->GetMakefile()->GetTargets(); const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
cmMakefile* makefile=(*it)->GetMakefile(); cmMakefile* makefile=(*it)->GetMakefile();
std::string subdir = (*it)->Convert(makefile->GetCurrentOutputDirectory(), std::string subdir = (*it)->Convert(makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
if (subdir == ".") if (subdir == ".")
{ {
@ -1094,7 +1094,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
ti->first.c_str()); ti->first.c_str());
std::string cleanArgs = "-E chdir \""; std::string cleanArgs = "-E chdir \"";
cleanArgs += makefile->GetCurrentOutputDirectory(); cleanArgs += makefile->GetCurrentBinaryDirectory();
cleanArgs += "\" \""; cleanArgs += "\" \"";
cleanArgs += cmake; cleanArgs += cmake;
cleanArgs += "\" -P \""; cleanArgs += "\" -P \"";

View File

@ -123,7 +123,7 @@ cmExtraKateGenerator::WriteTargets(const cmMakefile* mf,
{ {
const cmTargets& targets = (*it)->GetMakefile()->GetTargets(); const cmTargets& targets = (*it)->GetMakefile()->GetTargets();
cmMakefile* makefile=(*it)->GetMakefile(); cmMakefile* makefile=(*it)->GetMakefile();
std::string currentDir = makefile->GetCurrentOutputDirectory(); std::string currentDir = makefile->GetCurrentBinaryDirectory();
bool topLevel = (currentDir == makefile->GetHomeOutputDirectory()); bool topLevel = (currentDir == makefile->GetHomeOutputDirectory());
for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti) for(cmTargets::const_iterator ti=targets.begin(); ti!=targets.end(); ++ti)

View File

@ -41,7 +41,7 @@ void cmExtraQbsGenerator::CreateProjectFile(
const std::vector<cmLocalGenerator *> &lgs) const std::vector<cmLocalGenerator *> &lgs)
{ {
const cmMakefile *mf = lgs[0]->GetMakefile(); const cmMakefile *mf = lgs[0]->GetMakefile();
std::string outputDir = mf->GetStartOutputDirectory(); std::string outputDir = mf->GetCurrentBinaryDirectory();
const std::string filename = outputDir + "/" + name + ".qbs"; const std::string filename = outputDir + "/" + name + ".qbs";
@ -81,7 +81,7 @@ void cmExtraQbsGenerator::AppendSubProject(cmGeneratedFileStream &fout,
} }
const std::string &relativePath = cmSystemTools::RelativePath( const std::string &relativePath = cmSystemTools::RelativePath(
mk->GetHomeDirectory(), mk->GetCurrentDirectory()); mk->GetHomeDirectory(), mk->GetCurrentSourceDirectory());
fout << "\tProject {\n" fout << "\tProject {\n"
<< "\t\tname:\"" << relativePath << "\"\n"; << "\t\tname:\"" << relativePath << "\"\n";
this->AppendProduct(fout, lg); this->AppendProduct(fout, lg);

View File

@ -79,7 +79,7 @@ void cmExtraSublimeTextGenerator::CreateProjectFile(
const std::vector<cmLocalGenerator*>& lgs) const std::vector<cmLocalGenerator*>& lgs)
{ {
const cmMakefile* mf=lgs[0]->GetMakefile(); const cmMakefile* mf=lgs[0]->GetMakefile();
std::string outputDir=mf->GetStartOutputDirectory(); std::string outputDir=mf->GetCurrentBinaryDirectory();
std::string projectName=mf->GetProjectName(); std::string projectName=mf->GetProjectName();
const std::string filename = const std::string filename =
@ -174,7 +174,7 @@ void cmExtraSublimeTextGenerator::
{ {
// Only add the global targets from CMAKE_BINARY_DIR, // Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs // not from the subdirs
if (strcmp(makefile->GetStartOutputDirectory(), if (strcmp(makefile->GetCurrentBinaryDirectory(),
makefile->GetHomeOutputDirectory())==0) makefile->GetHomeOutputDirectory())==0)
{ {
this->AppendTarget(fout, ti->first, *lg, 0, this->AppendTarget(fout, ti->first, *lg, 0,

View File

@ -24,7 +24,7 @@ bool cmFLTKWrapUICommand
} }
// what is the current source dir // what is the current source dir
std::string cdir = this->Makefile->GetCurrentDirectory(); std::string cdir = this->Makefile->GetCurrentSourceDirectory();
const char* fluid_exe = const char* fluid_exe =
this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE"); this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE");
@ -32,7 +32,7 @@ bool cmFLTKWrapUICommand
this->Target = args[0]; // Target that will use the generated files this->Target = args[0]; // Target that will use the generated files
// get the list of GUI files from which .cxx and .h will be generated // get the list of GUI files from which .cxx and .h will be generated
std::string outputDirectory = this->Makefile->GetCurrentOutputDirectory(); std::string outputDirectory = this->Makefile->GetCurrentBinaryDirectory();
{ {
// Some of the generated files are *.h so the directory "GUI" // Some of the generated files are *.h so the directory "GUI"
@ -124,7 +124,7 @@ void cmFLTKWrapUICommand::FinalPass()
"FLTK_WRAP_UI was called with a target that was never created: "; "FLTK_WRAP_UI was called with a target that was never created: ";
msg += this->Target; msg += this->Target;
msg +=". The problem was found while processing the source directory: "; msg +=". The problem was found while processing the source directory: ";
msg += this->Makefile->GetStartDirectory(); msg += this->Makefile->GetCurrentSourceDirectory();
msg += ". This FLTK_WRAP_UI call will be ignored."; msg += ". This FLTK_WRAP_UI call will be ignored.";
cmSystemTools::Message(msg.c_str(),"Warning"); cmSystemTools::Message(msg.c_str(),"Warning");
return; return;
@ -156,7 +156,7 @@ void cmFLTKWrapUICommand::FinalPass()
"for you as was done in CMake 2.0 and earlier. In the future this may " "for you as was done in CMake 2.0 and earlier. In the future this may "
"become an error."; "become an error.";
msg +="The problem was found while processing the source directory: "; msg +="The problem was found while processing the source directory: ";
msg += this->Makefile->GetStartDirectory(); msg += this->Makefile->GetCurrentSourceDirectory();
cmSystemTools::Message(msg.c_str(),"Warning"); cmSystemTools::Message(msg.c_str(),"Warning");
// first we add the rules for all the .fl to .h and .cxx files // first we add the rules for all the .fl to .h and .cxx files
size_t lastHeadersClass = this->GeneratedSourcesClasses.size(); size_t lastHeadersClass = this->GeneratedSourcesClasses.size();

View File

@ -227,7 +227,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
std::string fileName = *i; std::string fileName = *i;
if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
{ {
fileName = this->Makefile->GetCurrentDirectory(); fileName = this->Makefile->GetCurrentSourceDirectory();
fileName += "/" + *i; fileName += "/" + *i;
} }
@ -309,7 +309,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args)
std::string fileName = fileNameArg.GetString(); std::string fileName = fileNameArg.GetString();
if ( !cmsys::SystemTools::FileIsFullPath(fileName.c_str()) ) if ( !cmsys::SystemTools::FileIsFullPath(fileName.c_str()) )
{ {
fileName = this->Makefile->GetCurrentDirectory(); fileName = this->Makefile->GetCurrentSourceDirectory();
fileName += "/" + fileNameArg.GetString(); fileName += "/" + fileNameArg.GetString();
} }
@ -445,7 +445,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
std::string fileName = args[1]; std::string fileName = args[1];
if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str()))
{ {
fileName = this->Makefile->GetCurrentDirectory(); fileName = this->Makefile->GetCurrentSourceDirectory();
fileName += "/" + args[1]; fileName += "/" + args[1];
} }
@ -645,7 +645,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if (hex_conversion_enabled) if (hex_conversion_enabled)
{ {
// TODO: should work without temp file, but just on a memory buffer // TODO: should work without temp file, but just on a memory buffer
std::string binaryFileName = this->Makefile->GetCurrentOutputDirectory(); std::string binaryFileName = this->Makefile->GetCurrentBinaryDirectory();
binaryFileName += cmake::GetCMakeFilesDirectory(); binaryFileName += cmake::GetCMakeFilesDirectory();
binaryFileName += "/FileCommandStringsBinaryFile"; binaryFileName += "/FileCommandStringsBinaryFile";
if(cmHexFileConverter::TryConvert(fileName.c_str(),binaryFileName.c_str())) if(cmHexFileConverter::TryConvert(fileName.c_str(),binaryFileName.c_str()))
@ -984,7 +984,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
cmsys::Glob::GlobMessages globMessages; cmsys::Glob::GlobMessages globMessages;
if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
{ {
std::string expr = this->Makefile->GetCurrentDirectory(); std::string expr = this->Makefile->GetCurrentSourceDirectory();
// Handle script mode // Handle script mode
if (!expr.empty()) if (!expr.empty())
{ {
@ -1091,7 +1091,7 @@ bool cmFileCommand::HandleMakeDirectoryCommand(
const std::string* cdir = &(*i); const std::string* cdir = &(*i);
if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) )
{ {
expr = this->Makefile->GetCurrentDirectory(); expr = this->Makefile->GetCurrentSourceDirectory();
expr += "/" + *i; expr += "/" + *i;
cdir = &expr; cdir = &expr;
} }
@ -1556,7 +1556,7 @@ bool cmFileCopier::CheckValue(std::string const& arg)
} }
else else
{ {
std::string file = this->Makefile->GetCurrentDirectory(); std::string file = this->Makefile->GetCurrentSourceDirectory();
file += "/" + arg; file += "/" + arg;
this->Files.push_back(file); this->Files.push_back(file);
} }
@ -1568,7 +1568,7 @@ bool cmFileCopier::CheckValue(std::string const& arg)
} }
else else
{ {
this->Destination = this->Makefile->GetCurrentOutputDirectory(); this->Destination = this->Makefile->GetCurrentBinaryDirectory();
this->Destination += "/" + arg; this->Destination += "/" + arg;
} }
this->Doing = DoingNone; this->Doing = DoingNone;
@ -2658,13 +2658,13 @@ bool cmFileCommand::HandleRename(std::vector<std::string> const& args)
std::string oldname = args[1]; std::string oldname = args[1];
if(!cmsys::SystemTools::FileIsFullPath(oldname.c_str())) if(!cmsys::SystemTools::FileIsFullPath(oldname.c_str()))
{ {
oldname = this->Makefile->GetCurrentDirectory(); oldname = this->Makefile->GetCurrentSourceDirectory();
oldname += "/" + args[1]; oldname += "/" + args[1];
} }
std::string newname = args[2]; std::string newname = args[2];
if(!cmsys::SystemTools::FileIsFullPath(newname.c_str())) if(!cmsys::SystemTools::FileIsFullPath(newname.c_str()))
{ {
newname = this->Makefile->GetCurrentDirectory(); newname = this->Makefile->GetCurrentSourceDirectory();
newname += "/" + args[2]; newname += "/" + args[2];
} }
@ -2698,7 +2698,7 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
std::string fileName = *i; std::string fileName = *i;
if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str()))
{ {
fileName = this->Makefile->GetCurrentDirectory(); fileName = this->Makefile->GetCurrentSourceDirectory();
fileName += "/" + *i; fileName += "/" + *i;
} }
@ -3743,7 +3743,7 @@ bool cmFileCommand::HandleLockCommand(
if (!cmsys::SystemTools::FileIsFullPath(path)) if (!cmsys::SystemTools::FileIsFullPath(path))
{ {
path = this->Makefile->GetCurrentDirectory() + ("/" + path); path = this->Makefile->GetCurrentSourceDirectory() + ("/" + path);
} }
// Unify path (remove '//', '/../', ...) // Unify path (remove '//', '/../', ...)

View File

@ -663,7 +663,7 @@ bool cmFindPackageCommand::HandlePackageMode()
if(!cmSystemTools::FileIsFullPath(dir.c_str())) if(!cmSystemTools::FileIsFullPath(dir.c_str()))
{ {
dir = "/" + dir; dir = "/" + dir;
dir = this->Makefile->GetCurrentDirectory() + dir; dir = this->Makefile->GetCurrentSourceDirectory() + dir;
} }
// The file location was cached. Look for the correct file. // The file location was cached. Look for the correct file.
std::string file; std::string file;

View File

@ -1099,8 +1099,8 @@ bool cmStrictTargetComparison::operator()(cmTarget const* t1,
int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str()); int nameResult = strcmp(t1->GetName().c_str(), t2->GetName().c_str());
if (nameResult == 0) if (nameResult == 0)
{ {
return strcmp(t1->GetMakefile()->GetStartOutputDirectory(), return strcmp(t1->GetMakefile()->GetCurrentBinaryDirectory(),
t2->GetMakefile()->GetStartOutputDirectory()) < 0; t2->GetMakefile()->GetCurrentBinaryDirectory()) < 0;
} }
return nameResult < 0; return nameResult < 0;
} }

View File

@ -43,7 +43,7 @@ bool cmGetDirectoryPropertyCommand
// make sure the start dir is a full path // make sure the start dir is a full path
if (!cmSystemTools::FileIsFullPath(sd.c_str())) if (!cmSystemTools::FileIsFullPath(sd.c_str()))
{ {
sd = this->Makefile->GetStartDirectory(); sd = this->Makefile->GetCurrentSourceDirectory();
sd += "/"; sd += "/";
sd += *i; sd += *i;
} }

View File

@ -97,7 +97,7 @@ bool cmGetFilenameComponentCommand
// If the path given is relative evaluate it relative to the // If the path given is relative evaluate it relative to the
// current source directory. // current source directory.
result = cmSystemTools::CollapseFullPath( result = cmSystemTools::CollapseFullPath(
filename, this->Makefile->GetCurrentDirectory()); filename, this->Makefile->GetCurrentSourceDirectory());
if(args[2] == "REALPATH") if(args[2] == "REALPATH")
{ {
// Resolve symlinks if possible // Resolve symlinks if possible

View File

@ -255,7 +255,7 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
std::string dir = this->Name; std::string dir = this->Name;
if(!cmSystemTools::FileIsFullPath(dir.c_str())) if(!cmSystemTools::FileIsFullPath(dir.c_str()))
{ {
dir = this->Makefile->GetCurrentDirectory(); dir = this->Makefile->GetCurrentSourceDirectory();
dir += "/"; dir += "/";
dir += this->Name; dir += this->Name;
} }

View File

@ -29,7 +29,7 @@ void cmGlobalBorlandMakefileGenerator
cmMakefile *mf, cmMakefile *mf,
bool optional) bool optional)
{ {
std::string outdir = this->CMakeInstance->GetStartOutputDirectory(); std::string outdir = this->CMakeInstance->GetHomeOutputDirectory();
mf->AddDefinition("BORLAND", "1"); mf->AddDefinition("BORLAND", "1");
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32"); mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");

View File

@ -1098,14 +1098,13 @@ void cmGlobalGenerator::Configure()
this->LocalGenerators.push_back(lg); this->LocalGenerators.push_back(lg);
// set the Start directories // set the Start directories
cmMakefile* mf = lg->GetMakefile(); lg->GetMakefile()->SetCurrentSourceDirectory
lg->GetMakefile()->SetStartDirectory (this->CMakeInstance->GetHomeDirectory());
(this->CMakeInstance->GetStartDirectory()); lg->GetMakefile()->SetCurrentBinaryDirectory
lg->GetMakefile()->SetStartOutputDirectory (this->CMakeInstance->GetHomeOutputDirectory());
(this->CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
this->BinaryDirectories.insert(mf->GetStartOutputDirectory()); this->BinaryDirectories.insert(
this->CMakeInstance->GetHomeOutputDirectory());
// now do it // now do it
lg->Configure(); lg->Configure();
@ -1568,7 +1567,8 @@ void cmGlobalGenerator::CheckLocalGenerators()
text += "\n linked by target \""; text += "\n linked by target \"";
text += l->second.GetName(); text += l->second.GetName();
text += "\" in directory "; text += "\" in directory ";
text+=this->LocalGenerators[i]->GetMakefile()->GetCurrentDirectory(); text+=this->LocalGenerators[i]->GetMakefile()
->GetCurrentSourceDirectory();
notFoundMap[varName] = text; notFoundMap[varName] = text;
} }
} }
@ -1598,7 +1598,7 @@ void cmGlobalGenerator::CheckLocalGenerators()
std::string text = notFoundMap[varName]; std::string text = notFoundMap[varName];
text += "\n used as include directory in directory "; text += "\n used as include directory in directory ";
text += this->LocalGenerators[i] text += this->LocalGenerators[i]
->GetMakefile()->GetCurrentDirectory(); ->GetMakefile()->GetCurrentSourceDirectory();
notFoundMap[varName] = text; notFoundMap[varName] = text;
} }
} }
@ -2046,7 +2046,7 @@ cmGlobalGenerator::FindLocalGenerator(const std::string& start_dir) const
for(std::vector<cmLocalGenerator*>::const_iterator it = for(std::vector<cmLocalGenerator*>::const_iterator it =
this->LocalGenerators.begin(); it != this->LocalGenerators.end(); ++it) this->LocalGenerators.begin(); it != this->LocalGenerators.end(); ++it)
{ {
std::string sd = (*it)->GetMakefile()->GetStartDirectory(); std::string sd = (*it)->GetMakefile()->GetCurrentSourceDirectory();
if (sd == start_dir) if (sd == start_dir)
{ {
return *it; return *it;
@ -2136,7 +2136,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
const char* cmakeCommand = mf->GetRequiredDefinition("CMAKE_COMMAND"); const char* cmakeCommand = mf->GetRequiredDefinition("CMAKE_COMMAND");
// CPack // CPack
std::string workingDir = mf->GetStartOutputDirectory(); std::string workingDir = mf->GetCurrentBinaryDirectory();
cmCustomCommandLines cpackCommandLines; cmCustomCommandLines cpackCommandLines;
std::vector<std::string> depends; std::vector<std::string> depends;
cmCustomCommandLine singleLine; cmCustomCommandLine singleLine;
@ -2147,7 +2147,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
singleLine.push_back(cmakeCfgIntDir); singleLine.push_back(cmakeCfgIntDir);
} }
singleLine.push_back("--config"); singleLine.push_back("--config");
std::string configFile = mf->GetStartOutputDirectory();; std::string configFile = mf->GetCurrentBinaryDirectory();;
configFile += "/CPackConfig.cmake"; configFile += "/CPackConfig.cmake";
std::string relConfigFile = "./CPackConfig.cmake"; std::string relConfigFile = "./CPackConfig.cmake";
singleLine.push_back(relConfigFile); singleLine.push_back(relConfigFile);
@ -2183,7 +2183,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
depends.erase(depends.begin(), depends.end()); depends.erase(depends.begin(), depends.end());
singleLine.push_back(cmSystemTools::GetCPackCommand()); singleLine.push_back(cmSystemTools::GetCPackCommand());
singleLine.push_back("--config"); singleLine.push_back("--config");
configFile = mf->GetStartOutputDirectory();; configFile = mf->GetCurrentBinaryDirectory();;
configFile += "/CPackSourceConfig.cmake"; configFile += "/CPackSourceConfig.cmake";
relConfigFile = "./CPackSourceConfig.cmake"; relConfigFile = "./CPackSourceConfig.cmake";
singleLine.push_back(relConfigFile); singleLine.push_back(relConfigFile);
@ -3070,7 +3070,7 @@ bool cmGlobalGenerator::GenerateCPackPropertiesFile()
std::vector<std::string> configs; std::vector<std::string> configs;
std::string config = mf->GetConfigurations(configs, false); std::string config = mf->GetConfigurations(configs, false);
std::string path = this->CMakeInstance->GetStartOutputDirectory(); std::string path = this->CMakeInstance->GetHomeOutputDirectory();
path += "/CPackProperties.cmake"; path += "/CPackProperties.cmake";
if(!cmSystemTools::FileExists(path.c_str()) && installedFiles.empty()) if(!cmSystemTools::FileExists(path.c_str()) && installedFiles.empty())

View File

@ -50,7 +50,7 @@ void cmGlobalKdevelopGenerator::Generate()
++it) ++it)
{ {
cmMakefile* mf = it->second[0]->GetMakefile(); cmMakefile* mf = it->second[0]->GetMakefile();
std::string outputDir=mf->GetStartOutputDirectory(); std::string outputDir=mf->GetCurrentBinaryDirectory();
std::string projectDir=mf->GetHomeDirectory(); std::string projectDir=mf->GetHomeDirectory();
std::string projectName=mf->GetProjectName(); std::string projectName=mf->GetProjectName();
std::string cmakeFilePattern("CMakeLists.txt;*.cmake;"); std::string cmakeFilePattern("CMakeLists.txt;*.cmake;");

View File

@ -679,7 +679,7 @@ void cmGlobalNinjaGenerator
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir; std::string dir;
dir += gt->Makefile->GetCurrentOutputDirectory(); dir += gt->Makefile->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
dir += gt->LocalGenerator->GetTargetDirectory(*target); dir += gt->LocalGenerator->GetTargetDirectory(*target);
dir += "/"; dir += "/";
@ -886,7 +886,7 @@ cmGlobalNinjaGenerator
case cmTarget::OBJECT_LIBRARY: case cmTarget::OBJECT_LIBRARY:
case cmTarget::UTILITY: { case cmTarget::UTILITY: {
std::string path = ng->ConvertToNinjaPath( std::string path = ng->ConvertToNinjaPath(
target->GetMakefile()->GetStartOutputDirectory()); target->GetMakefile()->GetCurrentBinaryDirectory());
if (path.empty() || path == ".") if (path.empty() || path == ".")
outputs.push_back(target->GetName()); outputs.push_back(target->GetName());
else { else {

View File

@ -113,7 +113,7 @@ cmGlobalUnixMakefileGenerator3
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir; std::string dir;
dir += gt->Makefile->GetCurrentOutputDirectory(); dir += gt->Makefile->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
dir += gt->LocalGenerator->GetTargetDirectory(*target); dir += gt->LocalGenerator->GetTargetDirectory(*target);
dir += "/"; dir += "/";
@ -158,7 +158,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
{ {
cmLocalUnixMakefileGenerator3 *lg = cmLocalUnixMakefileGenerator3 *lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]); static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory(); std::string markFileName = lg->GetMakefile()->GetCurrentBinaryDirectory();
markFileName += "/"; markFileName += "/";
markFileName += cmake::GetCMakeFilesDirectory(); markFileName += cmake::GetCMakeFilesDirectory();
markFileName += "/progress.marks"; markFileName += "/progress.marks";
@ -390,7 +390,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
{ {
lg = lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]); static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
tmpStr = lg->GetMakefile()->GetStartOutputDirectory(); tmpStr = lg->GetMakefile()->GetCurrentBinaryDirectory();
tmpStr += cmake::GetCMakeFilesDirectory(); tmpStr += cmake::GetCMakeFilesDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake"; tmpStr += "/CMakeDirectoryInformation.cmake";
cmakefileStream << " \"" << cmakefileStream << " \"" <<
@ -449,7 +449,7 @@ cmGlobalUnixMakefileGenerator3
bool check_relink) bool check_relink)
{ {
// Get the relative path to the subdirectory from the top. // Get the relative path to the subdirectory from the top.
std::string makeTarget = lg->GetMakefile()->GetStartOutputDirectory(); std::string makeTarget = lg->GetMakefile()->GetCurrentBinaryDirectory();
makeTarget += "/"; makeTarget += "/";
makeTarget += pass; makeTarget += pass;
@ -494,7 +494,7 @@ cmGlobalUnixMakefileGenerator3
{ {
cmLocalUnixMakefileGenerator3* slg = cmLocalUnixMakefileGenerator3* slg =
static_cast<cmLocalUnixMakefileGenerator3*>(*sdi); static_cast<cmLocalUnixMakefileGenerator3*>(*sdi);
std::string subdir = slg->GetMakefile()->GetStartOutputDirectory(); std::string subdir = slg->GetMakefile()->GetCurrentBinaryDirectory();
subdir += "/"; subdir += "/";
subdir += pass; subdir += pass;
depends.push_back(subdir); depends.push_back(subdir);
@ -529,7 +529,7 @@ cmGlobalUnixMakefileGenerator3
} }
// Begin the directory-level rules section. // Begin the directory-level rules section.
std::string dir = lg->GetMakefile()->GetStartOutputDirectory(); std::string dir = lg->GetMakefile()->GetCurrentBinaryDirectory();
dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT, dir = lg->Convert(dir, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKERULE); cmLocalGenerator::MAKERULE);
lg->WriteDivider(ruleFileStream); lg->WriteDivider(ruleFileStream);
@ -583,11 +583,10 @@ void cmGlobalUnixMakefileGenerator3
lg = static_cast<cmLocalUnixMakefileGenerator3 *> lg = static_cast<cmLocalUnixMakefileGenerator3 *>
(this->CreateLocalGenerator()); (this->CreateLocalGenerator());
// set the Start directories // set the Start directories
lg->GetMakefile()->SetStartDirectory lg->GetMakefile()->SetCurrentSourceDirectory
(this->CMakeInstance->GetStartDirectory()); (this->CMakeInstance->GetHomeDirectory());
lg->GetMakefile()->SetStartOutputDirectory lg->GetMakefile()->SetCurrentBinaryDirectory
(this->CMakeInstance->GetStartOutputDirectory()); (this->CMakeInstance->GetHomeOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
} }
std::string tname = targetName; std::string tname = targetName;

View File

@ -338,7 +338,7 @@ void cmGlobalVisualStudio10Generator::Generate()
" " << this->LongestSource.SourceFile->GetFullPath() << "\n" " " << this->LongestSource.SourceFile->GetFullPath() << "\n"
"This is because some Visual Studio tools would append the relative " "This is because some Visual Studio tools would append the relative "
"path to the end of the referencing directory path, as in:\n" "path to the end of the referencing directory path, as in:\n"
" " << mf->GetCurrentOutputDirectory() << "/" " " << mf->GetCurrentBinaryDirectory() << "/"
<< this->LongestSource.SourceRel << "\n" << this->LongestSource.SourceRel << "\n"
"and then incorrectly complain that the file does not exist because " "and then incorrectly complain that the file does not exist because "
"the path length is too long for some internal buffer or API. " "the path length is too long for some internal buffer or API. "
@ -585,7 +585,7 @@ cmGlobalVisualStudio10Generator
void cmGlobalVisualStudio10Generator::PathTooLong( void cmGlobalVisualStudio10Generator::PathTooLong(
cmTarget* target, cmSourceFile const* sf, std::string const& sfRel) cmTarget* target, cmSourceFile const* sf, std::string const& sfRel)
{ {
size_t len = (strlen(target->GetMakefile()->GetCurrentOutputDirectory()) + size_t len = (strlen(target->GetMakefile()->GetCurrentBinaryDirectory()) +
1 + sfRel.length()); 1 + sfRel.length());
if(len > this->LongestSource.Length) if(len > this->LongestSource.Length)
{ {

View File

@ -239,7 +239,7 @@ void cmGlobalVisualStudio6Generator
else else
{ {
std::string dspname = GetVS6TargetName(target->GetName()); std::string dspname = GetVS6TargetName(target->GetName());
std::string dir = target->GetMakefile()->GetStartOutputDirectory(); std::string dir = target->GetMakefile()->GetCurrentBinaryDirectory();
dir = root->Convert(dir.c_str(), cmLocalGenerator::START_OUTPUT); dir = root->Convert(dir.c_str(), cmLocalGenerator::START_OUTPUT);
this->WriteProject(fout, dspname.c_str(), dir.c_str(), *target); this->WriteProject(fout, dspname.c_str(), dir.c_str(), *target);
} }
@ -257,7 +257,7 @@ void cmGlobalVisualStudio6Generator
{ {
return; return;
} }
std::string fname = root->GetMakefile()->GetStartOutputDirectory(); std::string fname = root->GetMakefile()->GetCurrentBinaryDirectory();
fname += "/"; fname += "/";
fname += root->GetMakefile()->GetProjectName(); fname += root->GetMakefile()->GetProjectName();
fname += ".dsw"; fname += ".dsw";
@ -386,7 +386,7 @@ cmGlobalVisualStudio6Generator::WriteUtilityDepend(cmTarget const* target)
std::string pname = target->GetName(); std::string pname = target->GetName();
pname += "_UTILITY"; pname += "_UTILITY";
pname = GetVS6TargetName(pname.c_str()); pname = GetVS6TargetName(pname.c_str());
std::string fname = target->GetMakefile()->GetStartOutputDirectory(); std::string fname = target->GetMakefile()->GetCurrentBinaryDirectory();
fname += "/"; fname += "/";
fname += pname; fname += pname;
fname += ".dsp"; fname += ".dsp";

View File

@ -379,7 +379,7 @@ void cmGlobalVisualStudio7Generator
return; return;
} }
this->CurrentProject = root->GetMakefile()->GetProjectName(); this->CurrentProject = root->GetMakefile()->GetProjectName();
std::string fname = root->GetMakefile()->GetStartOutputDirectory(); std::string fname = root->GetMakefile()->GetCurrentBinaryDirectory();
fname += "/"; fname += "/";
fname += root->GetMakefile()->GetProjectName(); fname += root->GetMakefile()->GetProjectName();
fname += ".sln"; fname += ".sln";
@ -485,7 +485,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if(vcprojName) if(vcprojName)
{ {
cmMakefile* tmf = target->GetMakefile(); cmMakefile* tmf = target->GetMakefile();
std::string dir = tmf->GetStartOutputDirectory(); std::string dir = tmf->GetCurrentBinaryDirectory();
dir = root->Convert(dir.c_str(), dir = root->Convert(dir.c_str(),
cmLocalGenerator::START_OUTPUT); cmLocalGenerator::START_OUTPUT);
if(dir == ".") if(dir == ".")
@ -561,7 +561,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
target->GetProperty("GENERATOR_FILE_NAME"); target->GetProperty("GENERATOR_FILE_NAME");
if (vcprojName) if (vcprojName)
{ {
std::string dir = mf->GetStartDirectory(); std::string dir = mf->GetCurrentSourceDirectory();
this->WriteProjectDepends(fout, vcprojName, this->WriteProjectDepends(fout, vcprojName,
dir.c_str(), *target); dir.c_str(), *target);
} }
@ -903,7 +903,7 @@ cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget const* target)
{ {
std::string pname = target->GetName(); std::string pname = target->GetName();
pname += "_UTILITY"; pname += "_UTILITY";
std::string fname = target->GetMakefile()->GetStartOutputDirectory(); std::string fname = target->GetMakefile()->GetCurrentBinaryDirectory();
fname += "/"; fname += "/";
fname += pname; fname += pname;
fname += ".vcproj"; fname += ".vcproj";

View File

@ -281,7 +281,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
stampList += "generate.stamp.list"; stampList += "generate.stamp.list";
{ {
std::string stampListFile = std::string stampListFile =
generators[0]->GetMakefile()->GetCurrentOutputDirectory(); generators[0]->GetMakefile()->GetCurrentBinaryDirectory();
stampListFile += "/"; stampListFile += "/";
stampListFile += stampList; stampListFile += stampList;
std::string stampFile; std::string stampFile;
@ -289,7 +289,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
for(std::vector<cmLocalGenerator*>::const_iterator for(std::vector<cmLocalGenerator*>::const_iterator
gi = generators.begin(); gi != generators.end(); ++gi) gi = generators.begin(); gi != generators.end(); ++gi)
{ {
stampFile = (*gi)->GetMakefile()->GetCurrentOutputDirectory(); stampFile = (*gi)->GetMakefile()->GetCurrentBinaryDirectory();
stampFile += "/"; stampFile += "/";
stampFile += cmake::GetCMakeFilesDirectoryPostSlash(); stampFile += cmake::GetCMakeFilesDirectoryPostSlash();
stampFile += "generate.stamp"; stampFile += "generate.stamp";

View File

@ -121,7 +121,7 @@ void cmGlobalVisualStudioGenerator::Generate()
void cmGlobalVisualStudioGenerator void cmGlobalVisualStudioGenerator
::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const ::ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const
{ {
std::string dir = gt->Makefile->GetCurrentOutputDirectory(); std::string dir = gt->Makefile->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
std::string tgtDir = gt->LocalGenerator->GetTargetDirectory(*gt->Target); std::string tgtDir = gt->LocalGenerator->GetTargetDirectory(*gt->Target);
if(!tgtDir.empty()) if(!tgtDir.empty())
@ -225,7 +225,7 @@ cmGlobalVisualStudioGenerator
} }
else else
{ {
topLevelSlnName = mf->GetStartOutputDirectory(); topLevelSlnName = mf->GetCurrentBinaryDirectory();
topLevelSlnName += "/"; topLevelSlnName += "/";
topLevelSlnName += mf->GetProjectName(); topLevelSlnName += mf->GetProjectName();
topLevelSlnName += ".sln"; topLevelSlnName += ".sln";

View File

@ -407,13 +407,13 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
{ {
this->CurrentProject = root->GetMakefile()->GetProjectName(); this->CurrentProject = root->GetMakefile()->GetProjectName();
this->SetCurrentLocalGenerator(root); this->SetCurrentLocalGenerator(root);
cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentDirectory(), cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(),
this->ProjectSourceDirectoryComponents); this->ProjectSourceDirectoryComponents);
cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentOutputDirectory(), cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentBinaryDirectory(),
this->ProjectOutputDirectoryComponents); this->ProjectOutputDirectoryComponents);
this->CurrentXCodeHackMakefile = this->CurrentXCodeHackMakefile =
root->GetMakefile()->GetCurrentOutputDirectory(); root->GetMakefile()->GetCurrentBinaryDirectory();
this->CurrentXCodeHackMakefile += "/CMakeScripts"; this->CurrentXCodeHackMakefile += "/CMakeScripts";
cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str()); cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile.c_str());
this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make"; this->CurrentXCodeHackMakefile += "/XCODE_DEPEND_HELPER.make";
@ -453,13 +453,13 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
cmTarget* allbuild = mf->FindTarget("ALL_BUILD"); cmTarget* allbuild = mf->FindTarget("ALL_BUILD");
// Refer to the main build configuration file for easy editing. // Refer to the main build configuration file for easy editing.
std::string listfile = mf->GetStartDirectory(); std::string listfile = mf->GetCurrentSourceDirectory();
listfile += "/"; listfile += "/";
listfile += "CMakeLists.txt"; listfile += "CMakeLists.txt";
allbuild->AddSourceCMP0049(listfile.c_str()); allbuild->AddSourceCMP0049(listfile.c_str());
// Add XCODE depend helper // Add XCODE depend helper
std::string dir = mf->GetCurrentOutputDirectory(); std::string dir = mf->GetCurrentBinaryDirectory();
cmCustomCommandLine makeHelper; cmCustomCommandLine makeHelper;
if(this->XcodeVersion < 50) if(this->XcodeVersion < 50)
{ {
@ -538,7 +538,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
} }
// Refer to the build configuration file for easy editing. // Refer to the build configuration file for easy editing.
listfile = lg->GetMakefile()->GetStartDirectory(); listfile = lg->GetMakefile()->GetCurrentSourceDirectory();
listfile += "/"; listfile += "/";
listfile += "CMakeLists.txt"; listfile += "CMakeLists.txt";
target.AddSourceCMP0049(listfile.c_str()); target.AddSourceCMP0049(listfile.c_str());
@ -564,7 +564,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
std::vector<std::string>::iterator new_end = std::vector<std::string>::iterator new_end =
std::unique(lfiles.begin(), lfiles.end()); std::unique(lfiles.begin(), lfiles.end());
lfiles.erase(new_end, lfiles.end()); lfiles.erase(new_end, lfiles.end());
this->CurrentReRunCMakeMakefile = mf->GetStartOutputDirectory(); this->CurrentReRunCMakeMakefile = mf->GetCurrentBinaryDirectory();
this->CurrentReRunCMakeMakefile += "/CMakeScripts"; this->CurrentReRunCMakeMakefile += "/CMakeScripts";
cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str()); cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str());
this->CurrentReRunCMakeMakefile += "/ReRunCMake.make"; this->CurrentReRunCMakeMakefile += "/ReRunCMake.make";
@ -1012,7 +1012,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
this->CurrentMakefile = gen->GetMakefile(); this->CurrentMakefile = gen->GetMakefile();
std::string outdir = std::string outdir =
cmSystemTools::CollapseFullPath(this->CurrentMakefile-> cmSystemTools::CollapseFullPath(this->CurrentMakefile->
GetCurrentOutputDirectory()); GetCurrentBinaryDirectory());
cmSystemTools::SplitPath(outdir.c_str(), cmSystemTools::SplitPath(outdir.c_str(),
this->CurrentOutputDirectoryComponents); this->CurrentOutputDirectoryComponents);
@ -1366,7 +1366,7 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmTarget& cmtarget)
// linker language. This should convince Xcode to choose the proper // linker language. This should convince Xcode to choose the proper
// language. // language.
cmMakefile* mf = cmtarget.GetMakefile(); cmMakefile* mf = cmtarget.GetMakefile();
std::string fname = mf->GetCurrentOutputDirectory(); std::string fname = mf->GetCurrentBinaryDirectory();
fname += cmake::GetCMakeFilesDirectory(); fname += cmake::GetCMakeFilesDirectory();
fname += "/"; fname += "/";
fname += cmtarget.GetName(); fname += cmtarget.GetName();
@ -1594,7 +1594,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
const & commands, const & commands,
const char* name) const char* name)
{ {
std::string dir = this->CurrentMakefile->GetCurrentOutputDirectory(); std::string dir = this->CurrentMakefile->GetCurrentBinaryDirectory();
dir += "/CMakeScripts"; dir += "/CMakeScripts";
cmSystemTools::MakeDirectory(dir.c_str()); cmSystemTools::MakeDirectory(dir.c_str());
std::string makefile = dir; std::string makefile = dir;
@ -1615,7 +1615,7 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase,
currentConfig->c_str()); currentConfig->c_str());
} }
std::string cdir = this->CurrentMakefile->GetCurrentOutputDirectory(); std::string cdir = this->CurrentMakefile->GetCurrentBinaryDirectory();
cdir = this->ConvertToRelativeForXCode(cdir.c_str()); cdir = this->ConvertToRelativeForXCode(cdir.c_str());
std::string makecmd = "make -C "; std::string makecmd = "make -C ";
makecmd += cdir; makecmd += cdir;
@ -1943,7 +1943,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
} }
// Set attributes to specify the proper name for the target. // Set attributes to specify the proper name for the target.
std::string pndir = this->CurrentMakefile->GetCurrentOutputDirectory(); std::string pndir = this->CurrentMakefile->GetCurrentBinaryDirectory();
if(target.GetType() == cmTarget::STATIC_LIBRARY || if(target.GetType() == cmTarget::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY || target.GetType() == cmTarget::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY || target.GetType() == cmTarget::MODULE_LIBRARY ||
@ -3342,7 +3342,7 @@ bool cmGlobalXCodeGenerator
// Point Xcode at the top of the source tree. // Point Xcode at the top of the source tree.
{ {
std::string pdir = std::string pdir =
this->RelativeToBinary(root->GetMakefile()->GetCurrentDirectory()); this->RelativeToBinary(root->GetMakefile()->GetCurrentSourceDirectory());
this->RootObject->AddAttribute("projectDirPath", this->RootObject->AddAttribute("projectDirPath",
this->CreateString(pdir.c_str())); this->CreateString(pdir.c_str()));
this->RootObject->AddAttribute("projectRoot", this->CreateString("")); this->RootObject->AddAttribute("projectRoot", this->CreateString(""));
@ -3454,7 +3454,7 @@ bool cmGlobalXCodeGenerator
} }
} }
std::string symroot = root->GetMakefile()->GetCurrentOutputDirectory(); std::string symroot = root->GetMakefile()->GetCurrentBinaryDirectory();
symroot += "/build"; symroot += "/build";
buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str())); buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot.c_str()));
@ -3516,7 +3516,7 @@ cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
const cmTarget *t) const const cmTarget *t) const
{ {
std::string dir = std::string dir =
t->GetMakefile()->GetCurrentOutputDirectory(); t->GetMakefile()->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
dir += projName; dir += projName;
dir += ".build/"; dir += ".build/";
@ -3696,7 +3696,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
{ {
return; return;
} }
std::string xcodeDir = root->GetMakefile()->GetStartOutputDirectory(); std::string xcodeDir = root->GetMakefile()->GetCurrentBinaryDirectory();
xcodeDir += "/"; xcodeDir += "/";
xcodeDir += root->GetMakefile()->GetProjectName(); xcodeDir += root->GetMakefile()->GetProjectName();
xcodeDir += ".xcode"; xcodeDir += ".xcode";
@ -4016,7 +4016,7 @@ void cmGlobalXCodeGenerator::AppendFlag(std::string& flags,
std::string std::string
cmGlobalXCodeGenerator::ComputeInfoPListLocation(cmTarget& target) cmGlobalXCodeGenerator::ComputeInfoPListLocation(cmTarget& target)
{ {
std::string plist = target.GetMakefile()->GetCurrentOutputDirectory(); std::string plist = target.GetMakefile()->GetCurrentBinaryDirectory();
plist += cmake::GetCMakeFilesDirectory(); plist += cmake::GetCMakeFilesDirectory();
plist += "/"; plist += "/";
plist += target.GetName(); plist += target.GetName();

View File

@ -91,7 +91,7 @@ bool cmIncludeCommand
std::string fname_abs = std::string fname_abs =
cmSystemTools::CollapseFullPath(fname, cmSystemTools::CollapseFullPath(fname,
this->Makefile->GetStartDirectory()); this->Makefile->GetCurrentSourceDirectory());
cmGlobalGenerator *gg = this->Makefile->GetLocalGenerator() cmGlobalGenerator *gg = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator(); ->GetGlobalGenerator();

View File

@ -149,7 +149,7 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc)
{ {
if(!StartsWithGeneratorExpression(inc)) if(!StartsWithGeneratorExpression(inc))
{ {
std::string tmp = this->Makefile->GetStartDirectory(); std::string tmp = this->Makefile->GetCurrentSourceDirectory();
tmp += "/"; tmp += "/";
tmp += inc; tmp += inc;
inc = tmp; inc = tmp;

View File

@ -163,7 +163,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args)
std::string script = args[i]; std::string script = args[i];
if(!cmSystemTools::FileIsFullPath(script.c_str())) if(!cmSystemTools::FileIsFullPath(script.c_str()))
{ {
script = this->Makefile->GetCurrentDirectory(); script = this->Makefile->GetCurrentSourceDirectory();
script += "/"; script += "/";
script += args[i]; script += args[i];
} }
@ -1093,7 +1093,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
std::string dir = args[i]; std::string dir = args[i];
if(!cmSystemTools::FileIsFullPath(dir.c_str())) if(!cmSystemTools::FileIsFullPath(dir.c_str()))
{ {
dir = this->Makefile->GetCurrentDirectory(); dir = this->Makefile->GetCurrentSourceDirectory();
dir += "/"; dir += "/";
dir += args[i]; dir += args[i];
} }
@ -1376,7 +1376,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName,
std::string::size_type gpos = cmGeneratorExpression::Find(file); std::string::size_type gpos = cmGeneratorExpression::Find(file);
if(gpos != 0 && !cmSystemTools::FileIsFullPath(file.c_str())) if(gpos != 0 && !cmSystemTools::FileIsFullPath(file.c_str()))
{ {
file = this->Makefile->GetCurrentDirectory(); file = this->Makefile->GetCurrentSourceDirectory();
file += "/"; file += "/";
file += *fileIt; file += *fileIt;
} }

View File

@ -59,7 +59,7 @@ void cmInstallExportGenerator::ComputeTempDir()
{ {
// Choose a temporary directory in which to generate the import // Choose a temporary directory in which to generate the import
// files to be installed. // files to be installed.
this->TempDir = this->Makefile->GetCurrentOutputDirectory(); this->TempDir = this->Makefile->GetCurrentBinaryDirectory();
this->TempDir += cmake::GetCMakeFilesDirectory(); this->TempDir += cmake::GetCMakeFilesDirectory();
this->TempDir += "/Export"; this->TempDir += "/Export";
if(this->Destination.empty()) if(this->Destination.empty())

View File

@ -95,7 +95,7 @@ void cmInstallFilesCommand::FinalPass()
{ {
std::vector<std::string> files; std::vector<std::string> files;
std::string regex = this->FinalArgs[0]; std::string regex = this->FinalArgs[0];
cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(), cmSystemTools::Glob(this->Makefile->GetCurrentSourceDirectory(),
regex, files); regex, files);
std::vector<std::string>::iterator s = files.begin(); std::vector<std::string>::iterator s = files.begin();
@ -152,10 +152,10 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const
} }
// This is a relative path. // This is a relative path.
std::string tb = this->Makefile->GetCurrentOutputDirectory(); std::string tb = this->Makefile->GetCurrentBinaryDirectory();
tb += "/"; tb += "/";
tb += name; tb += name;
std::string ts = this->Makefile->GetCurrentDirectory(); std::string ts = this->Makefile->GetCurrentSourceDirectory();
ts += "/"; ts += "/";
ts += name; ts += name;

View File

@ -63,7 +63,7 @@ void cmInstallProgramsCommand::FinalPass()
else // reg exp list else // reg exp list
{ {
std::vector<std::string> programs; std::vector<std::string> programs;
cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(), cmSystemTools::Glob(this->Makefile->GetCurrentSourceDirectory(),
this->FinalArgs[0], programs); this->FinalArgs[0], programs);
std::vector<std::string>::iterator s = programs.begin(); std::vector<std::string>::iterator s = programs.begin();
@ -115,10 +115,10 @@ std::string cmInstallProgramsCommand
} }
// This is a relative path. // This is a relative path.
std::string tb = this->Makefile->GetCurrentOutputDirectory(); std::string tb = this->Makefile->GetCurrentBinaryDirectory();
tb += "/"; tb += "/";
tb += name; tb += name;
std::string ts = this->Makefile->GetCurrentDirectory(); std::string ts = this->Makefile->GetCurrentSourceDirectory();
ts += "/"; ts += "/";
ts += name; ts += name;

View File

@ -69,7 +69,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
std::string fromDirConfig; std::string fromDirConfig;
if(this->Target->NeedRelinkBeforeInstall(config)) if(this->Target->NeedRelinkBeforeInstall(config))
{ {
fromDirConfig = this->Target->GetMakefile()->GetStartOutputDirectory(); fromDirConfig = this->Target->GetMakefile()->GetCurrentBinaryDirectory();
fromDirConfig += cmake::GetCMakeFilesDirectory(); fromDirConfig += cmake::GetCMakeFilesDirectory();
fromDirConfig += "/CMakeRelink.dir/"; fromDirConfig += "/CMakeRelink.dir/";
} }

View File

@ -60,7 +60,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
} }
if (convertToAbsolute) if (convertToAbsolute)
{ {
std::string tmp = this->Makefile->GetStartDirectory(); std::string tmp = this->Makefile->GetCurrentSourceDirectory();
tmp += "/"; tmp += "/";
tmp += unixPath; tmp += unixPath;
unixPath = tmp; unixPath = tmp;

View File

@ -101,7 +101,7 @@ void cmLocalGenerator::Configure()
static_cast<void>(clg); static_cast<void>(clg);
// make sure the CMakeFiles dir is there // make sure the CMakeFiles dir is there
std::string filesDir = this->Makefile->GetStartOutputDirectory(); std::string filesDir = this->Makefile->GetCurrentBinaryDirectory();
filesDir += cmake::GetCMakeFilesDirectory(); filesDir += cmake::GetCMakeFilesDirectory();
cmSystemTools::MakeDirectory(filesDir.c_str()); cmSystemTools::MakeDirectory(filesDir.c_str());
@ -177,7 +177,7 @@ void cmLocalGenerator::ComputeObjectMaxPath()
void cmLocalGenerator::ReadInputFile() void cmLocalGenerator::ReadInputFile()
{ {
// Look for the CMakeLists.txt file. // Look for the CMakeLists.txt file.
std::string currentStart = this->Makefile->GetStartDirectory(); std::string currentStart = this->Makefile->GetCurrentSourceDirectory();
currentStart += "/CMakeLists.txt"; currentStart += "/CMakeLists.txt";
if(cmSystemTools::FileExists(currentStart.c_str(), true)) if(cmSystemTools::FileExists(currentStart.c_str(), true))
{ {
@ -194,7 +194,7 @@ void cmLocalGenerator::ReadInputFile()
cmMakefile* mf = this->Parent->GetMakefile(); cmMakefile* mf = this->Parent->GetMakefile();
std::ostringstream e; std::ostringstream e;
e << "The source directory\n" e << "The source directory\n"
<< " " << this->Makefile->GetStartDirectory() << "\n" << " " << this->Makefile->GetCurrentSourceDirectory() << "\n"
<< "does not contain a CMakeLists.txt file."; << "does not contain a CMakeLists.txt file.";
switch (mf->GetPolicyStatus(cmPolicies::CMP0014)) switch (mf->GetPolicyStatus(cmPolicies::CMP0014))
{ {
@ -230,7 +230,8 @@ void cmLocalGenerator::SetupPathConversions()
cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory()); cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory());
cmSystemTools::SplitPath(outdir, this->HomeDirectoryComponents); cmSystemTools::SplitPath(outdir, this->HomeDirectoryComponents);
outdir = outdir =
cmSystemTools::CollapseFullPath(this->Makefile->GetStartDirectory()); cmSystemTools::CollapseFullPath(
this->Makefile->GetCurrentSourceDirectory());
cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents); cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath outdir = cmSystemTools::CollapseFullPath
@ -239,7 +240,7 @@ void cmLocalGenerator::SetupPathConversions()
this->HomeOutputDirectoryComponents); this->HomeOutputDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath outdir = cmSystemTools::CollapseFullPath
(this->Makefile->GetStartOutputDirectory()); (this->Makefile->GetCurrentBinaryDirectory());
cmSystemTools::SplitPath(outdir, cmSystemTools::SplitPath(outdir,
this->StartOutputDirectoryComponents); this->StartOutputDirectoryComponents);
} }
@ -250,12 +251,6 @@ void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
this->GlobalGenerator = gg; this->GlobalGenerator = gg;
this->Makefile = new cmMakefile; this->Makefile = new cmMakefile;
this->Makefile->SetLocalGenerator(this); this->Makefile->SetLocalGenerator(this);
// setup the home directories
this->Makefile->SetHomeDirectory(
gg->GetCMakeInstance()->GetHomeDirectory());
this->Makefile->SetHomeOutputDirectory(
gg->GetCMakeInstance()->GetHomeOutputDirectory());
} }
void cmLocalGenerator::ConfigureFinalPass() void cmLocalGenerator::ConfigureFinalPass()
@ -302,7 +297,7 @@ void cmLocalGenerator::GenerateTestFiles()
const std::string& config = const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false); this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory(); std::string file = this->Makefile->GetCurrentBinaryDirectory();
file += "/"; file += "/";
file += "CTestTestfile.cmake"; file += "CTestTestfile.cmake";
@ -311,9 +306,9 @@ void cmLocalGenerator::GenerateTestFiles()
fout << "# CMake generated Testfile for " << std::endl fout << "# CMake generated Testfile for " << std::endl
<< "# Source directory: " << "# Source directory: "
<< this->Makefile->GetStartDirectory() << std::endl << this->Makefile->GetCurrentSourceDirectory() << std::endl
<< "# Build directory: " << "# Build directory: "
<< this->Makefile->GetStartOutputDirectory() << std::endl << this->Makefile->GetCurrentBinaryDirectory() << std::endl
<< "# " << std::endl << "# " << std::endl
<< "# This file includes the relevant testing commands " << "# This file includes the relevant testing commands "
<< "required for " << std::endl << "required for " << std::endl
@ -343,7 +338,7 @@ void cmLocalGenerator::GenerateTestFiles()
// TODO: Use add_subdirectory instead? // TODO: Use add_subdirectory instead?
fout << "subdirs("; fout << "subdirs(";
std::string outP = std::string outP =
this->Children[i]->GetMakefile()->GetStartOutputDirectory(); this->Children[i]->GetMakefile()->GetCurrentBinaryDirectory();
fout << this->Convert(outP,START_OUTPUT); fout << this->Convert(outP,START_OUTPUT);
fout << ")" << std::endl; fout << ")" << std::endl;
} }
@ -427,9 +422,9 @@ void cmLocalGenerator::GenerateInstallRules()
} }
// Create the install script file. // Create the install script file.
std::string file = this->Makefile->GetStartOutputDirectory(); std::string file = this->Makefile->GetCurrentBinaryDirectory();
std::string homedir = this->Makefile->GetHomeOutputDirectory(); std::string homedir = this->Makefile->GetHomeOutputDirectory();
std::string currdir = this->Makefile->GetCurrentOutputDirectory(); std::string currdir = this->Makefile->GetCurrentBinaryDirectory();
cmSystemTools::ConvertToUnixSlashes(file); cmSystemTools::ConvertToUnixSlashes(file);
cmSystemTools::ConvertToUnixSlashes(homedir); cmSystemTools::ConvertToUnixSlashes(homedir);
cmSystemTools::ConvertToUnixSlashes(currdir); cmSystemTools::ConvertToUnixSlashes(currdir);
@ -444,7 +439,8 @@ void cmLocalGenerator::GenerateInstallRules()
// Write the header. // Write the header.
fout << "# Install script for directory: " fout << "# Install script for directory: "
<< this->Makefile->GetCurrentDirectory() << std::endl << std::endl; << this->Makefile->GetCurrentSourceDirectory()
<< std::endl << std::endl;
fout << "# Set the install prefix" << std::endl fout << "# Set the install prefix" << std::endl
<< "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl << "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl
<< " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl << " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl
@ -516,7 +512,7 @@ void cmLocalGenerator::GenerateInstallRules()
{ {
if(!(*ci)->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL")) if(!(*ci)->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{ {
std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory(); std::string odir = (*ci)->GetMakefile()->GetCurrentBinaryDirectory();
cmSystemTools::ConvertToUnixSlashes(odir); cmSystemTools::ConvertToUnixSlashes(odir);
fout << " include(\"" << odir fout << " include(\"" << odir
<< "/cmake_install.cmake\")" << std::endl; << "/cmake_install.cmake\")" << std::endl;
@ -652,7 +648,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
source.GetFullPath(), source.GetFullPath(),
commandLines, commandLines,
comment.c_str(), comment.c_str(),
this->Makefile->GetStartOutputDirectory() this->Makefile->GetCurrentBinaryDirectory()
); );
} }
@ -674,12 +670,12 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
!sf->GetPropertyAsBool("EXTERNAL_OBJECT")) !sf->GetPropertyAsBool("EXTERNAL_OBJECT"))
{ {
std::string dir_max; std::string dir_max;
dir_max += this->Makefile->GetCurrentOutputDirectory(); dir_max += this->Makefile->GetCurrentBinaryDirectory();
dir_max += "/"; dir_max += "/";
std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max); std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max);
if(!obj.empty()) if(!obj.empty())
{ {
std::string ofname = this->Makefile->GetCurrentOutputDirectory(); std::string ofname = this->Makefile->GetCurrentBinaryDirectory();
ofname += "/"; ofname += "/";
ofname += obj; ofname += obj;
objVector.push_back(ofname); objVector.push_back(ofname);
@ -749,7 +745,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
"", "",
commandLines, commandLines,
comment.c_str(), comment.c_str(),
this->Makefile->GetStartOutputDirectory() this->Makefile->GetCurrentBinaryDirectory()
); );
this->Makefile->GetSource(targetFullPath); this->Makefile->GetSource(targetFullPath);
target.Target->AddSource(targetFullPath); target.Target->AddSource(targetFullPath);
@ -1553,18 +1549,19 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
if(includeBinaryDir) if(includeBinaryDir)
{ {
if(emitted.find( if(emitted.find(
this->Makefile->GetStartOutputDirectory()) == emitted.end()) this->Makefile->GetCurrentBinaryDirectory()) == emitted.end())
{ {
dirs.push_back(this->Makefile->GetStartOutputDirectory()); dirs.push_back(this->Makefile->GetCurrentBinaryDirectory());
emitted.insert(this->Makefile->GetStartOutputDirectory()); emitted.insert(this->Makefile->GetCurrentBinaryDirectory());
} }
} }
if(includeSourceDir) if(includeSourceDir)
{ {
if(emitted.find(this->Makefile->GetStartDirectory()) == emitted.end()) if(emitted.find(
this->Makefile->GetCurrentSourceDirectory()) == emitted.end())
{ {
dirs.push_back(this->Makefile->GetStartDirectory()); dirs.push_back(this->Makefile->GetCurrentSourceDirectory());
emitted.insert(this->Makefile->GetStartDirectory()); emitted.insert(this->Makefile->GetCurrentSourceDirectory());
} }
} }
@ -2165,7 +2162,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
// Treat the name as relative to the source directory in which it // Treat the name as relative to the source directory in which it
// was given. // was given.
dep = this->Makefile->GetCurrentDirectory(); dep = this->Makefile->GetCurrentSourceDirectory();
dep += "/"; dep += "/";
dep += inName; dep += inName;
return true; return true;
@ -2719,9 +2716,9 @@ const char* cmLocalGenerator::GetRelativeRootPath(RelativeRoot relroot)
switch (relroot) switch (relroot)
{ {
case HOME: return this->Makefile->GetHomeDirectory(); case HOME: return this->Makefile->GetHomeDirectory();
case START: return this->Makefile->GetStartDirectory(); case START: return this->Makefile->GetCurrentSourceDirectory();
case HOME_OUTPUT: return this->Makefile->GetHomeOutputDirectory(); case HOME_OUTPUT: return this->Makefile->GetHomeOutputDirectory();
case START_OUTPUT: return this->Makefile->GetStartOutputDirectory(); case START_OUTPUT: return this->Makefile->GetCurrentBinaryDirectory();
default: break; default: break;
} }
return 0; return 0;
@ -2849,14 +2846,14 @@ std::string cmLocalGenerator::FindRelativePathTopSource()
{ {
std::string parentTop = parent->FindRelativePathTopSource(); std::string parentTop = parent->FindRelativePathTopSource();
if(cmSystemTools::IsSubDirectory( if(cmSystemTools::IsSubDirectory(
this->Makefile->GetStartDirectory(), parentTop)) this->Makefile->GetCurrentSourceDirectory(), parentTop))
{ {
return parentTop; return parentTop;
} }
} }
// Otherwise this directory itself is the new top. // Otherwise this directory itself is the new top.
return this->Makefile->GetStartDirectory(); return this->Makefile->GetCurrentSourceDirectory();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -2869,14 +2866,14 @@ std::string cmLocalGenerator::FindRelativePathTopBinary()
{ {
std::string parentTop = parent->FindRelativePathTopBinary(); std::string parentTop = parent->FindRelativePathTopBinary();
if(cmSystemTools::IsSubDirectory( if(cmSystemTools::IsSubDirectory(
this->Makefile->GetStartOutputDirectory(), parentTop)) this->Makefile->GetCurrentBinaryDirectory(), parentTop))
{ {
return parentTop; return parentTop;
} }
} }
// Otherwise this directory itself is the new top. // Otherwise this directory itself is the new top.
return this->Makefile->GetStartOutputDirectory(); return this->Makefile->GetCurrentBinaryDirectory();
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -46,7 +46,7 @@ void cmLocalGhsMultiGenerator::Configure()
// Compute the path to use when referencing the current output // Compute the path to use when referencing the current output
// directory from the top output directory. // directory from the top output directory.
this->HomeRelativeOutputPath = this->HomeRelativeOutputPath =
this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT); this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
if (this->HomeRelativeOutputPath == ".") if (this->HomeRelativeOutputPath == ".")
{ {
this->HomeRelativeOutputPath = ""; this->HomeRelativeOutputPath = "";

View File

@ -102,7 +102,7 @@ void cmLocalNinjaGenerator::Configure()
// Compute the path to use when referencing the current output // Compute the path to use when referencing the current output
// directory from the top output directory. // directory from the top output directory.
this->HomeRelativeOutputPath = this->HomeRelativeOutputPath =
this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT); this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
if(this->HomeRelativeOutputPath == ".") if(this->HomeRelativeOutputPath == ".")
{ {
this->HomeRelativeOutputPath = ""; this->HomeRelativeOutputPath = "";
@ -407,7 +407,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
if (ccg.GetNumberOfCommands() > 0) { if (ccg.GetNumberOfCommands() > 0) {
std::string wd = ccg.GetWorkingDirectory(); std::string wd = ccg.GetWorkingDirectory();
if (wd.empty()) if (wd.empty())
wd = this->GetMakefile()->GetStartOutputDirectory(); wd = this->GetMakefile()->GetCurrentBinaryDirectory();
std::ostringstream cdCmd; std::ostringstream cdCmd;
#ifdef _WIN32 #ifdef _WIN32

View File

@ -106,7 +106,7 @@ void cmLocalUnixMakefileGenerator3::Configure()
// Compute the path to use when referencing the current output // Compute the path to use when referencing the current output
// directory from the top output directory. // directory from the top output directory.
this->HomeRelativeOutputPath = this->HomeRelativeOutputPath =
this->Convert(this->Makefile->GetStartOutputDirectory(), HOME_OUTPUT); this->Convert(this->Makefile->GetCurrentBinaryDirectory(), HOME_OUTPUT);
if(this->HomeRelativeOutputPath == ".") if(this->HomeRelativeOutputPath == ".")
{ {
this->HomeRelativeOutputPath = ""; this->HomeRelativeOutputPath = "";
@ -205,7 +205,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
->GetSafeDefinition("CMAKE_BUILD_TYPE")); ->GetSafeDefinition("CMAKE_BUILD_TYPE"));
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir; std::string dir;
dir += gt->Makefile->GetCurrentOutputDirectory(); dir += gt->Makefile->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
dir += this->GetTargetDirectory(*gt->Target); dir += this->GetTargetDirectory(*gt->Target);
dir += "/"; dir += "/";
@ -526,7 +526,7 @@ void cmLocalUnixMakefileGenerator3
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile() void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
{ {
std::string infoFileName = this->Makefile->GetStartOutputDirectory(); std::string infoFileName = this->Makefile->GetCurrentBinaryDirectory();
infoFileName += cmake::GetCMakeFilesDirectory(); infoFileName += cmake::GetCMakeFilesDirectory();
infoFileName += "/CMakeDirectoryInformation.cmake"; infoFileName += "/CMakeDirectoryInformation.cmake";
@ -588,7 +588,7 @@ std::string
cmLocalUnixMakefileGenerator3 cmLocalUnixMakefileGenerator3
::ConvertToFullPath(const std::string& localPath) ::ConvertToFullPath(const std::string& localPath)
{ {
std::string dir = this->Makefile->GetStartOutputDirectory(); std::string dir = this->Makefile->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
dir += localPath; dir += localPath;
return dir; return dir;
@ -1086,7 +1086,7 @@ cmLocalUnixMakefileGenerator3
} }
// if the command specified a working directory use it. // if the command specified a working directory use it.
std::string dir = this->Makefile->GetStartOutputDirectory(); std::string dir = this->Makefile->GetCurrentBinaryDirectory();
std::string workingDir = ccg.GetWorkingDirectory(); std::string workingDir = ccg.GetWorkingDirectory();
if(!workingDir.empty()) if(!workingDir.empty())
{ {
@ -1236,7 +1236,7 @@ cmLocalUnixMakefileGenerator3
const std::vector<std::string>& files, const std::vector<std::string>& files,
cmTarget& target, const char* filename) cmTarget& target, const char* filename)
{ {
std::string cleanfile = this->Makefile->GetCurrentOutputDirectory(); std::string cleanfile = this->Makefile->GetCurrentBinaryDirectory();
cleanfile += "/"; cleanfile += "/";
cleanfile += this->GetTargetDirectory(target); cleanfile += this->GetTargetDirectory(target);
cleanfile += "/cmake_clean"; cleanfile += "/cmake_clean";
@ -1515,7 +1515,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
// If the directory information is newer than depend.internal, include dirs // If the directory information is newer than depend.internal, include dirs
// may have changed. In this case discard all old dependencies. // may have changed. In this case discard all old dependencies.
bool needRescanDirInfo = false; bool needRescanDirInfo = false;
std::string dirInfoFile = this->Makefile->GetStartOutputDirectory(); std::string dirInfoFile = this->Makefile->GetCurrentBinaryDirectory();
dirInfoFile += cmake::GetCMakeFilesDirectory(); dirInfoFile += cmake::GetCMakeFilesDirectory();
dirInfoFile += "/CMakeDirectoryInformation.cmake"; dirInfoFile += "/CMakeDirectoryInformation.cmake";
{ {
@ -1589,7 +1589,7 @@ cmLocalUnixMakefileGenerator3
// Read the directory information file. // Read the directory information file.
cmMakefile* mf = this->Makefile; cmMakefile* mf = this->Makefile;
bool haveDirectoryInfo = false; bool haveDirectoryInfo = false;
std::string dirInfoFile = this->Makefile->GetStartOutputDirectory(); std::string dirInfoFile = this->Makefile->GetCurrentBinaryDirectory();
dirInfoFile += cmake::GetCMakeFilesDirectory(); dirInfoFile += cmake::GetCMakeFilesDirectory();
dirInfoFile += "/CMakeDirectoryInformation.cmake"; dirInfoFile += "/CMakeDirectoryInformation.cmake";
if(mf->ReadListFile(dirInfoFile.c_str()) && if(mf->ReadListFile(dirInfoFile.c_str()) &&
@ -1847,7 +1847,7 @@ void cmLocalUnixMakefileGenerator3
// Write the all rule. // Write the all rule.
std::string dir; std::string dir;
std::string recursiveTarget = this->Makefile->GetStartOutputDirectory(); std::string recursiveTarget = this->Makefile->GetCurrentBinaryDirectory();
recursiveTarget += "/all"; recursiveTarget += "/all";
depends.push_back("cmake_check_build_system"); depends.push_back("cmake_check_build_system");
@ -1891,7 +1891,7 @@ void cmLocalUnixMakefileGenerator3
depends, commands, true); depends, commands, true);
// Write the clean rule. // Write the clean rule.
recursiveTarget = this->Makefile->GetStartOutputDirectory(); recursiveTarget = this->Makefile->GetCurrentBinaryDirectory();
recursiveTarget += "/clean"; recursiveTarget += "/clean";
commands.clear(); commands.clear();
depends.clear(); depends.clear();
@ -1909,7 +1909,7 @@ void cmLocalUnixMakefileGenerator3
depends, commands, true); depends, commands, true);
// Write the preinstall rule. // Write the preinstall rule.
recursiveTarget = this->Makefile->GetStartOutputDirectory(); recursiveTarget = this->Makefile->GetCurrentBinaryDirectory();
recursiveTarget += "/preinstall"; recursiveTarget += "/preinstall";
commands.clear(); commands.clear();
depends.clear(); depends.clear();

View File

@ -117,14 +117,14 @@ void cmLocalVisualStudio6Generator::Generate()
void cmLocalVisualStudio6Generator::OutputDSPFile() void cmLocalVisualStudio6Generator::OutputDSPFile()
{ {
// If not an in source build, then create the output directory // If not an in source build, then create the output directory
if(strcmp(this->Makefile->GetStartOutputDirectory(), if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
this->Makefile->GetHomeDirectory()) != 0) this->Makefile->GetHomeDirectory()) != 0)
{ {
if(!cmSystemTools::MakeDirectory if(!cmSystemTools::MakeDirectory
(this->Makefile->GetStartOutputDirectory())) (this->Makefile->GetCurrentBinaryDirectory()))
{ {
cmSystemTools::Error("Error creating directory ", cmSystemTools::Error("Error creating directory ",
this->Makefile->GetStartOutputDirectory()); this->Makefile->GetCurrentBinaryDirectory());
} }
} }
@ -169,7 +169,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
std::string::size_type pos = l->first.rfind('/'); std::string::size_type pos = l->first.rfind('/');
if(pos != std::string::npos) if(pos != std::string::npos)
{ {
std::string dir = this->Makefile->GetStartOutputDirectory(); std::string dir = this->Makefile->GetCurrentBinaryDirectory();
dir += "/"; dir += "/";
dir += l->first.substr(0, pos); dir += l->first.substr(0, pos);
if(!cmSystemTools::MakeDirectory(dir.c_str())) if(!cmSystemTools::MakeDirectory(dir.c_str()))
@ -195,7 +195,7 @@ void cmLocalVisualStudio6Generator::CreateSingleDSP(const std::string& lname,
// create the dsp.cmake file // create the dsp.cmake file
std::string fname; std::string fname;
fname = this->Makefile->GetStartOutputDirectory(); fname = this->Makefile->GetCurrentBinaryDirectory();
fname += "/"; fname += "/";
fname += pname; fname += pname;
fname += ".dsp"; fname += ".dsp";
@ -223,7 +223,7 @@ void cmLocalVisualStudio6Generator::AddDSPBuildRule(cmTarget& tgt)
this->Makefile->GetRequiredDefinition("CMAKE_COMMAND"); this->Makefile->GetRequiredDefinition("CMAKE_COMMAND");
cmCustomCommandLine commandLine; cmCustomCommandLine commandLine;
commandLine.push_back(dsprule); commandLine.push_back(dsprule);
std::string makefileIn = this->Makefile->GetStartDirectory(); std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
makefileIn += "/"; makefileIn += "/";
makefileIn += "CMakeLists.txt"; makefileIn += "CMakeLists.txt";
if(!cmSystemTools::FileExists(makefileIn.c_str())) if(!cmSystemTools::FileExists(makefileIn.c_str()))
@ -585,9 +585,9 @@ cmLocalVisualStudio6Generator
const cmCustomCommand& origCommand) const cmCustomCommand& origCommand)
{ {
// Create a fake output that forces the rule to run. // Create a fake output that forces the rule to run.
char* output = new char[(strlen(this->Makefile->GetStartOutputDirectory()) + char* output = new char[(strlen(this->Makefile->GetCurrentBinaryDirectory())
target.GetName().size() + 30)]; + target.GetName().size() + 30)];
sprintf(output,"%s/%s_force_%i", this->Makefile->GetStartOutputDirectory(), sprintf(output,"%s/%s_force_%i", this->Makefile->GetCurrentBinaryDirectory(),
target.GetName().c_str(), count); target.GetName().c_str(), count);
const char* comment = origCommand.GetComment(); const char* comment = origCommand.GetComment();
if(!comment && origCommand.GetOutputs().empty()) if(!comment && origCommand.GetOutputs().empty())
@ -1968,7 +1968,7 @@ cmLocalVisualStudio6Generator
// files directory for any configuration. This is used to construct // files directory for any configuration. This is used to construct
// object file names that do not produce paths that are too long. // object file names that do not produce paths that are too long.
std::string dir_max; std::string dir_max;
dir_max += this->Makefile->GetCurrentOutputDirectory(); dir_max += this->Makefile->GetCurrentBinaryDirectory();
dir_max += "/"; dir_max += "/";
dir_max += config_max; dir_max += config_max;
dir_max += "/"; dir_max += "/";

View File

@ -151,7 +151,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
cmCustomCommandLines force_commands; cmCustomCommandLines force_commands;
force_commands.push_back(force_command); force_commands.push_back(force_command);
std::string no_main_dependency = ""; std::string no_main_dependency = "";
std::string force = this->Makefile->GetStartOutputDirectory(); std::string force = this->Makefile->GetCurrentBinaryDirectory();
force += cmake::GetCMakeFilesDirectory(); force += cmake::GetCMakeFilesDirectory();
force += "/"; force += "/";
force += tgt.GetName(); force += tgt.GetName();
@ -173,14 +173,14 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
void cmLocalVisualStudio7Generator::WriteProjectFiles() void cmLocalVisualStudio7Generator::WriteProjectFiles()
{ {
// If not an in source build, then create the output directory // If not an in source build, then create the output directory
if(strcmp(this->Makefile->GetStartOutputDirectory(), if(strcmp(this->Makefile->GetCurrentBinaryDirectory(),
this->Makefile->GetHomeDirectory()) != 0) this->Makefile->GetHomeDirectory()) != 0)
{ {
if(!cmSystemTools::MakeDirectory if(!cmSystemTools::MakeDirectory
(this->Makefile->GetStartOutputDirectory())) (this->Makefile->GetCurrentBinaryDirectory()))
{ {
cmSystemTools::Error("Error creating directory ", cmSystemTools::Error("Error creating directory ",
this->Makefile->GetStartOutputDirectory()); this->Makefile->GetCurrentBinaryDirectory());
} }
} }
@ -209,7 +209,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
{ {
// Touch a timestamp file used to determine when the project file is // Touch a timestamp file used to determine when the project file is
// out of date. // out of date.
std::string stampName = this->Makefile->GetStartOutputDirectory(); std::string stampName = this->Makefile->GetCurrentBinaryDirectory();
stampName += cmake::GetCMakeFilesDirectory(); stampName += cmake::GetCMakeFilesDirectory();
cmSystemTools::MakeDirectory(stampName.c_str()); cmSystemTools::MakeDirectory(stampName.c_str());
stampName += "/"; stampName += "/";
@ -257,7 +257,7 @@ void cmLocalVisualStudio7Generator
target.SetProperty("GENERATOR_FILE_NAME",lname.c_str()); target.SetProperty("GENERATOR_FILE_NAME",lname.c_str());
// create the dsp.cmake file // create the dsp.cmake file
std::string fname; std::string fname;
fname = this->Makefile->GetStartOutputDirectory(); fname = this->Makefile->GetCurrentBinaryDirectory();
fname += "/"; fname += "/";
fname += lname; fname += lname;
if(this->FortranProject) if(this->FortranProject)
@ -286,7 +286,7 @@ void cmLocalVisualStudio7Generator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
{ {
std::string stampName = this->Makefile->GetCurrentOutputDirectory(); std::string stampName = this->Makefile->GetCurrentBinaryDirectory();
stampName += "/"; stampName += "/";
stampName += cmake::GetCMakeFilesDirectoryPostSlash(); stampName += cmake::GetCMakeFilesDirectoryPostSlash();
stampName += "generate.stamp"; stampName += "generate.stamp";
@ -294,7 +294,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
this->Makefile->GetRequiredDefinition("CMAKE_COMMAND"); this->Makefile->GetRequiredDefinition("CMAKE_COMMAND");
cmCustomCommandLine commandLine; cmCustomCommandLine commandLine;
commandLine.push_back(dsprule); commandLine.push_back(dsprule);
std::string makefileIn = this->Makefile->GetStartDirectory(); std::string makefileIn = this->Makefile->GetCurrentSourceDirectory();
makefileIn += "/"; makefileIn += "/";
makefileIn += "CMakeLists.txt"; makefileIn += "CMakeLists.txt";
makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str()); makefileIn = cmSystemTools::CollapseFullPath(makefileIn.c_str());
@ -1707,7 +1707,7 @@ cmLocalVisualStudio7Generator
// files directory for any configuration. This is used to construct // files directory for any configuration. This is used to construct
// object file names that do not produce paths that are too long. // object file names that do not produce paths that are too long.
std::string dir_max; std::string dir_max;
dir_max += this->Makefile->GetCurrentOutputDirectory(); dir_max += this->Makefile->GetCurrentBinaryDirectory();
dir_max += "/"; dir_max += "/";
dir_max += this->GetTargetDirectory(target); dir_max += this->GetTargetDirectory(target);
dir_max += "/"; dir_max += "/";

View File

@ -179,11 +179,11 @@ void cmMakefile::Print() const
} }
std::cout << " this->StartOutputDirectory; " << std::cout << " this->StartOutputDirectory; " <<
this->StartOutputDirectory << std::endl; this->GetCurrentBinaryDirectory() << std::endl;
std::cout << " this->HomeOutputDirectory; " << std::cout << " this->HomeOutputDirectory; " <<
this->HomeOutputDirectory << std::endl; this->HomeOutputDirectory << std::endl;
std::cout << " this->cmStartDirectory; " << std::cout << " this->cmStartDirectory; " <<
this->cmStartDirectory << std::endl; this->GetCurrentSourceDirectory() << std::endl;
std::cout << " this->cmHomeDirectory; " << std::cout << " this->cmHomeDirectory; " <<
this->cmHomeDirectory << std::endl; this->cmHomeDirectory << std::endl;
std::cout << " this->ProjectName; " std::cout << " this->ProjectName; "
@ -223,7 +223,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
if(this->ListFileStack.empty()) if(this->ListFileStack.empty())
{ {
// We are not processing the project. Add the directory-level context. // We are not processing the project. Add the directory-level context.
lfc.FilePath = this->GetCurrentDirectory(); lfc.FilePath = this->GetCurrentSourceDirectory();
lfc.FilePath += "/CMakeLists.txt"; lfc.FilePath += "/CMakeLists.txt";
} }
else else
@ -480,8 +480,9 @@ bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
{ {
this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile); this->AddDefinition("CMAKE_PARENT_LIST_FILE", listfile);
this->cmCurrentListFile = listfile; this->cmCurrentListFile = listfile;
std::string curSrc = this->GetCurrentSourceDirectory();
return this->ReadListFile(listfile, true, return this->ReadListFile(listfile, true,
this->cmStartDirectory == this->cmHomeDirectory); curSrc == this->GetHomeDirectory());
} }
bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
@ -489,7 +490,7 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile()); this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetCurrentListFile());
this->cmCurrentListFile = this->cmCurrentListFile =
cmSystemTools::CollapseFullPath(listfile, cmSystemTools::CollapseFullPath(listfile,
this->cmStartDirectory.c_str()); this->GetCurrentSourceDirectory());
return this->ReadListFile(this->cmCurrentListFile.c_str(), return this->ReadListFile(this->cmCurrentListFile.c_str(),
noPolicyScope); noPolicyScope);
} }
@ -503,7 +504,7 @@ bool cmMakefile::ReadListFile(const char* listfile,
{ {
std::string filenametoread = std::string filenametoread =
cmSystemTools::CollapseFullPath(listfile, cmSystemTools::CollapseFullPath(listfile,
this->cmStartDirectory.c_str()); this->GetCurrentSourceDirectory());
std::string currentParentFile std::string currentParentFile
= this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE"); = this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
@ -650,6 +651,9 @@ void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
this->Properties.SetCMakeInstance(this->GetCMakeInstance()); this->Properties.SetCMakeInstance(this->GetCMakeInstance());
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused(); this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars(); this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
this->SetHomeDirectory(this->GetCMakeInstance()->GetHomeDirectory());
this->SetHomeOutputDirectory(
this->GetCMakeInstance()->GetHomeOutputDirectory());
} }
namespace namespace
@ -1187,7 +1191,7 @@ cmMakefile::AddUtilityCommand(const std::string& utilityName,
// Store the custom command in the target. // Store the custom command in the target.
if (!commandLines.empty() || !depends.empty()) if (!commandLines.empty() || !depends.empty())
{ {
std::string force = this->GetStartOutputDirectory(); std::string force = this->GetCurrentBinaryDirectory();
force += cmake::GetCMakeFilesDirectory(); force += cmake::GetCMakeFilesDirectory();
force += "/"; force += "/";
force += utilityName; force += utilityName;
@ -1497,6 +1501,11 @@ void cmMakefile::InitializeFromParent()
// Initialize definitions with the closure of the parent scope. // Initialize definitions with the closure of the parent scope.
this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure(); this->Internal->VarStack.top() = parent->Internal->VarStack.top().Closure();
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->GetCurrentSourceDirectory());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->GetCurrentBinaryDirectory());
const std::vector<cmValueWithOrigin>& parentIncludes = const std::vector<cmValueWithOrigin>& parentIncludes =
parent->GetIncludeDirectoriesEntries(); parent->GetIncludeDirectoriesEntries();
this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(), this->IncludeDirectoriesEntries.insert(this->IncludeDirectoriesEntries.end(),
@ -1565,11 +1574,10 @@ void cmMakefile::InitializeFromParent()
void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
{ {
lg2->GetMakefile()->InitializeFromParent(); lg2->GetMakefile()->InitializeFromParent();
lg2->GetMakefile()->MakeStartDirectoriesCurrent();
if (this->GetCMakeInstance()->GetDebugOutput()) if (this->GetCMakeInstance()->GetDebugOutput())
{ {
std::string msg=" Entering "; std::string msg=" Entering ";
msg += lg2->GetMakefile()->GetCurrentDirectory(); msg += lg2->GetMakefile()->GetCurrentSourceDirectory();
cmSystemTools::Message(msg.c_str()); cmSystemTools::Message(msg.c_str());
} }
// finally configure the subdir // finally configure the subdir
@ -1577,7 +1585,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
if (this->GetCMakeInstance()->GetDebugOutput()) if (this->GetCMakeInstance()->GetDebugOutput())
{ {
std::string msg=" Returning to "; std::string msg=" Returning to ";
msg += this->GetCurrentDirectory(); msg += this->GetCurrentSourceDirectory();
cmSystemTools::Message(msg.c_str()); cmSystemTools::Message(msg.c_str());
} }
} }
@ -1600,8 +1608,8 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
this->LocalGenerator->GetGlobalGenerator()->AddLocalGenerator(lg2); this->LocalGenerator->GetGlobalGenerator()->AddLocalGenerator(lg2);
// set the subdirs start dirs // set the subdirs start dirs
lg2->GetMakefile()->SetStartDirectory(srcPath); lg2->GetMakefile()->SetCurrentSourceDirectory(srcPath);
lg2->GetMakefile()->SetStartOutputDirectory(binPath); lg2->GetMakefile()->SetCurrentBinaryDirectory(binPath);
if(excludeFromAll) if(excludeFromAll)
{ {
lg2->GetMakefile()->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); lg2->GetMakefile()->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
@ -1613,6 +1621,37 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
} }
} }
void cmMakefile::SetCurrentSourceDirectory(const std::string& dir)
{
this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
this->cmStartDirectory =
cmSystemTools::CollapseFullPath(this->cmStartDirectory);
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
}
const char* cmMakefile::GetCurrentSourceDirectory() const
{
return this->cmStartDirectory.c_str();
}
void cmMakefile::SetCurrentBinaryDirectory(const std::string& dir)
{
this->StartOutputDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
this->StartOutputDirectory =
cmSystemTools::CollapseFullPath(this->StartOutputDirectory);
cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
}
const char* cmMakefile::GetCurrentBinaryDirectory() const
{
return this->StartOutputDirectory.c_str();
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs, void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs,
bool before) bool before)
@ -1809,7 +1848,7 @@ void cmMakefile::CheckForUnused(const char* reason,
} }
else else
{ {
path = this->GetStartDirectory(); path = this->GetCurrentSourceDirectory();
path += "/CMakeLists.txt"; path += "/CMakeLists.txt";
cmListFileContext lfc; cmListFileContext lfc;
lfc.FilePath = path; lfc.FilePath = path;
@ -3362,9 +3401,9 @@ const char* cmMakefile::GetHomeOutputDirectory() const
return this->HomeOutputDirectory.c_str(); return this->HomeOutputDirectory.c_str();
} }
void cmMakefile::SetHomeOutputDirectory(const std::string& lib) void cmMakefile::SetHomeOutputDirectory(const std::string& dir)
{ {
this->HomeOutputDirectory = lib; this->HomeOutputDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory); cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory);
this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory()); this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory());
if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") ) if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") )
@ -3491,8 +3530,6 @@ int cmMakefile::TryCompile(const std::string& srcdir,
// do a configure // do a configure
cm.SetHomeDirectory(srcdir); cm.SetHomeDirectory(srcdir);
cm.SetHomeOutputDirectory(bindir); cm.SetHomeOutputDirectory(bindir);
cm.SetStartDirectory(srcdir);
cm.SetStartOutputDirectory(bindir);
cm.SetGeneratorPlatform(this->GetCMakeInstance()->GetGeneratorPlatform()); cm.SetGeneratorPlatform(this->GetCMakeInstance()->GetGeneratorPlatform());
cm.SetGeneratorToolset(this->GetCMakeInstance()->GetGeneratorToolset()); cm.SetGeneratorToolset(this->GetCMakeInstance()->GetGeneratorToolset());
cm.LoadCache(); cm.LoadCache();
@ -3988,8 +4025,8 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value)
if ( prop == "ADDITIONAL_MAKE_CLEAN_FILES" ) if ( prop == "ADDITIONAL_MAKE_CLEAN_FILES" )
{ {
// This property is not inherrited // This property is not inherrited
if ( strcmp(this->GetCurrentDirectory(), if ( strcmp(this->GetCurrentSourceDirectory(),
this->GetStartDirectory()) != 0 ) this->GetCurrentSourceDirectory()) != 0 )
{ {
return; return;
} }
@ -4053,7 +4090,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
{ {
if(cmLocalGenerator* plg = this->LocalGenerator->GetParent()) if(cmLocalGenerator* plg = this->LocalGenerator->GetParent())
{ {
output = plg->GetMakefile()->GetStartDirectory(); output = plg->GetMakefile()->GetCurrentSourceDirectory();
} }
return output.c_str(); return output.c_str();
} }
@ -4256,7 +4293,7 @@ void cmMakefile::AddCMakeDependFilesFromUser()
} }
else else
{ {
std::string f = this->GetCurrentDirectory(); std::string f = this->GetCurrentSourceDirectory();
f += "/"; f += "/";
f += *i; f += *i;
this->AddCMakeDependFile(f); this->AddCMakeDependFile(f);
@ -4537,7 +4574,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
default: break; default: break;
} }
e << "created in source directory \"" e << "created in source directory \""
<< existing->GetMakefile()->GetCurrentDirectory() << "\". " << existing->GetMakefile()->GetCurrentSourceDirectory() << "\". "
<< "See documentation for policy CMP0002 for more details."; << "See documentation for policy CMP0002 for more details.";
msg = e.str(); msg = e.str();
return false; return false;

View File

@ -422,14 +422,6 @@ public:
bool HasCMP0054AlreadyBeenReported( bool HasCMP0054AlreadyBeenReported(
cmListFileContext context) const; cmListFileContext context) const;
void MakeStartDirectoriesCurrent()
{
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
}
//@{ //@{
/** /**
* Set/Get the home directory (or output directory) in the project. The * Set/Get the home directory (or output directory) in the project. The
@ -440,7 +432,7 @@ public:
*/ */
void SetHomeDirectory(const std::string& dir); void SetHomeDirectory(const std::string& dir);
const char* GetHomeDirectory() const; const char* GetHomeDirectory() const;
void SetHomeOutputDirectory(const std::string& lib); void SetHomeOutputDirectory(const std::string& dir);
const char* GetHomeOutputDirectory() const; const char* GetHomeOutputDirectory() const;
//@} //@}
@ -454,51 +446,10 @@ public:
*/ */
void SetArgcArgv(const std::vector<std::string>& args); void SetArgcArgv(const std::vector<std::string>& args);
//@{ void SetCurrentSourceDirectory(const std::string& dir);
/** const char* GetCurrentSourceDirectory() const;
* Set/Get the start directory (or output directory). The start directory void SetCurrentBinaryDirectory(const std::string& dir);
* is the directory of the CMakeLists.txt file that started the current const char* GetCurrentBinaryDirectory() const;
* round of processing. Remember that CMake processes CMakeLists files by
* recursing up the tree starting at the StartDirectory and going up until
* it reaches the HomeDirectory.
*/
void SetStartDirectory(const std::string& dir)
{
this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
this->cmStartDirectory =
cmSystemTools::CollapseFullPath(this->cmStartDirectory);
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
}
const char* GetStartDirectory() const
{
return this->cmStartDirectory.c_str();
}
void SetStartOutputDirectory(const std::string& lib)
{
this->StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
this->StartOutputDirectory =
cmSystemTools::CollapseFullPath(this->StartOutputDirectory);
cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
}
const char* GetStartOutputDirectory() const
{
return this->StartOutputDirectory.c_str();
}
//@}
const char* GetCurrentDirectory() const
{
return this->cmStartDirectory.c_str();
}
const char* GetCurrentOutputDirectory() const
{
return this->StartOutputDirectory.c_str();
}
/* Get the current CMakeLists.txt file that is being processed. This /* Get the current CMakeLists.txt file that is being processed. This
* is just used in order to be able to 'branch' from one file to a second * is just used in order to be able to 'branch' from one file to a second

View File

@ -108,7 +108,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string outpathImp; std::string outpathImp;
if(relink) if(relink)
{ {
outpath = this->Makefile->GetStartOutputDirectory(); outpath = this->Makefile->GetCurrentBinaryDirectory();
outpath += cmake::GetCMakeFilesDirectory(); outpath += cmake::GetCMakeFilesDirectory();
outpath += "/CMakeRelink.dir"; outpath += "/CMakeRelink.dir";
cmSystemTools::MakeDirectory(outpath.c_str()); cmSystemTools::MakeDirectory(outpath.c_str());
@ -419,7 +419,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
} }
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(commands1, (commands1,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands1.begin(), commands1.end()); commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear(); commands1.clear();
@ -433,7 +433,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
symlink += targetOutPath; symlink += targetOutPath;
commands1.push_back(symlink); commands1.push_back(symlink);
this->LocalGenerator->CreateCDCommand(commands1, this->LocalGenerator->CreateCDCommand(commands1,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands1.begin(), commands1.end()); commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear(); commands1.clear();

View File

@ -286,7 +286,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
} }
else if(relink) else if(relink)
{ {
outpath = this->Makefile->GetStartOutputDirectory(); outpath = this->Makefile->GetCurrentBinaryDirectory();
outpath += cmake::GetCMakeFilesDirectory(); outpath += cmake::GetCMakeFilesDirectory();
outpath += "/CMakeRelink.dir"; outpath += "/CMakeRelink.dir";
cmSystemTools::MakeDirectory(outpath.c_str()); cmSystemTools::MakeDirectory(outpath.c_str());
@ -445,7 +445,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
*this->Target, "target"); *this->Target, "target");
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(commands1, (commands1,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands1.begin(), commands1.end()); commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear(); commands1.clear();
@ -726,7 +726,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
} }
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(commands1, (commands1,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands1.begin(), commands1.end()); commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear(); commands1.clear();
@ -743,7 +743,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
symlink += targetOutPath; symlink += targetOutPath;
commands1.push_back(symlink); commands1.push_back(symlink);
this->LocalGenerator->CreateCDCommand(commands1, this->LocalGenerator->CreateCDCommand(commands1,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands1.begin(), commands1.end()); commands.insert(commands.end(), commands1.begin(), commands1.end());
commands1.clear(); commands1.clear();

View File

@ -495,7 +495,7 @@ void cmMakefileTargetGenerator
this->WriteObjectBuildFile(obj, lang, source, depends); this->WriteObjectBuildFile(obj, lang, source, depends);
// The object file should be checked for dependency integrity. // The object file should be checked for dependency integrity.
std::string objFullPath = this->Makefile->GetCurrentOutputDirectory(); std::string objFullPath = this->Makefile->GetCurrentBinaryDirectory();
objFullPath += "/"; objFullPath += "/";
objFullPath += obj; objFullPath += obj;
objFullPath = objFullPath =
@ -741,7 +741,7 @@ cmMakefileTargetGenerator
this->LocalGenerator->ExpandRuleVariables(compileCommand, vars); this->LocalGenerator->ExpandRuleVariables(compileCommand, vars);
std::string workingDirectory = std::string workingDirectory =
this->LocalGenerator->Convert( this->LocalGenerator->Convert(
this->Makefile->GetStartOutputDirectory(), cmLocalGenerator::FULL); this->Makefile->GetCurrentBinaryDirectory(), cmLocalGenerator::FULL);
compileCommand.replace(compileCommand.find(langFlags), compileCommand.replace(compileCommand.find(langFlags),
langFlags.size(), this->GetFlags(lang)); langFlags.size(), this->GetFlags(lang));
std::string langDefines = std::string("$(") + lang + "_DEFINES)"; std::string langDefines = std::string("$(") + lang + "_DEFINES)";
@ -761,7 +761,7 @@ cmMakefileTargetGenerator
// Change the command working directory to the local build tree. // Change the command working directory to the local build tree.
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(compileCommands, (compileCommands,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands.insert(commands.end(),
compileCommands.begin(), compileCommands.end()); compileCommands.begin(), compileCommands.end());
@ -834,7 +834,7 @@ cmMakefileTargetGenerator
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(preprocessCommands, (preprocessCommands,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands.insert(commands.end(),
preprocessCommands.begin(), preprocessCommands.begin(),
@ -891,7 +891,7 @@ cmMakefileTargetGenerator
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(assemblyCommands, (assemblyCommands,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
commands.insert(commands.end(), commands.insert(commands.end(),
assemblyCommands.begin(), assemblyCommands.begin(),
@ -992,7 +992,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules()
*this->Target); *this->Target);
this->LocalGenerator->CreateCDCommand this->LocalGenerator->CreateCDCommand
(commands, (commands,
this->Makefile->GetStartOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::HOME_OUTPUT); cmLocalGenerator::HOME_OUTPUT);
// Write the rule. // Write the rule.
@ -1139,7 +1139,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
{ {
cmMakefile* mf = linkee->GetMakefile(); cmMakefile* mf = linkee->GetMakefile();
cmLocalGenerator* lg = mf->GetLocalGenerator(); cmLocalGenerator* lg = mf->GetLocalGenerator();
std::string di = mf->GetStartOutputDirectory(); std::string di = mf->GetCurrentBinaryDirectory();
di += "/"; di += "/";
di += lg->GetTargetDirectory(*linkee); di += lg->GetTargetDirectory(*linkee);
di += "/DependInfo.cmake"; di += "/DependInfo.cmake";
@ -1199,13 +1199,13 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< this->Convert(this->Makefile->GetHomeDirectory(), << this->Convert(this->Makefile->GetHomeDirectory(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL) cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " " << " "
<< this->Convert(this->Makefile->GetStartDirectory(), << this->Convert(this->Makefile->GetCurrentSourceDirectory(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL) cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " " << " "
<< this->Convert(this->Makefile->GetHomeOutputDirectory(), << this->Convert(this->Makefile->GetHomeOutputDirectory(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL) cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " " << " "
<< this->Convert(this->Makefile->GetStartOutputDirectory(), << this->Convert(this->Makefile->GetCurrentBinaryDirectory(),
cmLocalGenerator::FULL, cmLocalGenerator::SHELL) cmLocalGenerator::FULL, cmLocalGenerator::SHELL)
<< " " << " "
<< this->Convert(this->InfoFileNameFull, << this->Convert(this->InfoFileNameFull,
@ -1968,7 +1968,7 @@ const char* cmMakefileTargetGenerator::GetFortranModuleDirectory()
{ {
// Interpret relative to the current output directory. // Interpret relative to the current output directory.
this->FortranModuleDirectory = this->FortranModuleDirectory =
this->Makefile->GetCurrentOutputDirectory(); this->Makefile->GetCurrentBinaryDirectory();
this->FortranModuleDirectory += "/"; this->FortranModuleDirectory += "/";
this->FortranModuleDirectory += target_mod_dir; this->FortranModuleDirectory += target_mod_dir;
} }

View File

@ -45,7 +45,8 @@ cmNinjaTargetGenerator::New(cmGeneratorTarget* target)
// (i.e. top-level) directory. CMake creates copies of these targets // (i.e. top-level) directory. CMake creates copies of these targets
// in every directory, which we don't need. // in every directory, which we don't need.
cmMakefile *mf = target->Target->GetMakefile(); cmMakefile *mf = target->Target->GetMakefile();
if (strcmp(mf->GetStartDirectory(), mf->GetHomeDirectory()) == 0) if (strcmp(mf->GetCurrentSourceDirectory(),
mf->GetHomeDirectory()) == 0)
return new cmNinjaUtilityTargetGenerator(target); return new cmNinjaUtilityTargetGenerator(target);
// else fallthrough // else fallthrough
} }

View File

@ -192,7 +192,7 @@ bool cmOutputRequiredFilesCommand
// compute the list of files // compute the list of files
cmLBDepend md; cmLBDepend md;
md.SetMakefile(this->Makefile); md.SetMakefile(this->Makefile);
md.AddSearchPath(this->Makefile->GetStartDirectory()); md.AddSearchPath(this->Makefile->GetCurrentSourceDirectory());
// find the depends for a file // find the depends for a file
const cmDependInformation *info = md.FindDependencies(this->File.c_str()); const cmDependInformation *info = md.FindDependencies(this->File.c_str());
if (info) if (info)

View File

@ -29,20 +29,20 @@ bool cmProjectCommand
this->Makefile->AddCacheDefinition this->Makefile->AddCacheDefinition
(bindir, (bindir,
this->Makefile->GetCurrentOutputDirectory(), this->Makefile->GetCurrentBinaryDirectory(),
"Value Computed by CMake", cmState::STATIC); "Value Computed by CMake", cmState::STATIC);
this->Makefile->AddCacheDefinition this->Makefile->AddCacheDefinition
(srcdir, (srcdir,
this->Makefile->GetCurrentDirectory(), this->Makefile->GetCurrentSourceDirectory(),
"Value Computed by CMake", cmState::STATIC); "Value Computed by CMake", cmState::STATIC);
bindir = "PROJECT_BINARY_DIR"; bindir = "PROJECT_BINARY_DIR";
srcdir = "PROJECT_SOURCE_DIR"; srcdir = "PROJECT_SOURCE_DIR";
this->Makefile->AddDefinition(bindir, this->Makefile->AddDefinition(bindir,
this->Makefile->GetCurrentOutputDirectory()); this->Makefile->GetCurrentBinaryDirectory());
this->Makefile->AddDefinition(srcdir, this->Makefile->AddDefinition(srcdir,
this->Makefile->GetCurrentDirectory()); this->Makefile->GetCurrentSourceDirectory());
this->Makefile->AddDefinition("PROJECT_NAME", args[0].c_str()); this->Makefile->AddDefinition("PROJECT_NAME", args[0].c_str());

View File

@ -41,7 +41,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
// Compute the name of the file to generate. // Compute the name of the file to generate.
std::string srcName = std::string srcName =
cmSystemTools::GetFilenameWithoutLastExtension(*j); cmSystemTools::GetFilenameWithoutLastExtension(*j);
std::string newName = this->Makefile->GetCurrentOutputDirectory(); std::string newName = this->Makefile->GetCurrentBinaryDirectory();
newName += "/moc_"; newName += "/moc_";
newName += srcName; newName += srcName;
newName += ".cxx"; newName += ".cxx";
@ -62,11 +62,11 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
{ {
if(curr && curr->GetPropertyAsBool("GENERATED")) if(curr && curr->GetPropertyAsBool("GENERATED"))
{ {
hname = this->Makefile->GetCurrentOutputDirectory(); hname = this->Makefile->GetCurrentBinaryDirectory();
} }
else else
{ {
hname = this->Makefile->GetCurrentDirectory(); hname = this->Makefile->GetCurrentSourceDirectory();
} }
hname += "/"; hname += "/";
hname += *j; hname += *j;

View File

@ -46,15 +46,15 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
// Compute the name of the files to generate. // Compute the name of the files to generate.
std::string srcName = std::string srcName =
cmSystemTools::GetFilenameWithoutLastExtension(*j); cmSystemTools::GetFilenameWithoutLastExtension(*j);
std::string hName = this->Makefile->GetCurrentOutputDirectory(); std::string hName = this->Makefile->GetCurrentBinaryDirectory();
hName += "/"; hName += "/";
hName += srcName; hName += srcName;
hName += ".h"; hName += ".h";
std::string cxxName = this->Makefile->GetCurrentOutputDirectory(); std::string cxxName = this->Makefile->GetCurrentBinaryDirectory();
cxxName += "/"; cxxName += "/";
cxxName += srcName; cxxName += srcName;
cxxName += ".cxx"; cxxName += ".cxx";
std::string mocName = this->Makefile->GetCurrentOutputDirectory(); std::string mocName = this->Makefile->GetCurrentBinaryDirectory();
mocName += "/moc_"; mocName += "/moc_";
mocName += srcName; mocName += srcName;
mocName += ".cxx"; mocName += ".cxx";
@ -69,11 +69,11 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
{ {
if(curr && curr->GetPropertyAsBool("GENERATED")) if(curr && curr->GetPropertyAsBool("GENERATED"))
{ {
uiName = this->Makefile->GetCurrentOutputDirectory(); uiName = this->Makefile->GetCurrentBinaryDirectory();
} }
else else
{ {
uiName = this->Makefile->GetCurrentDirectory(); uiName = this->Makefile->GetCurrentSourceDirectory();
} }
uiName += "/"; uiName += "/";
uiName += *j; uiName += *j;

View File

@ -162,7 +162,7 @@ static std::string getAutogenTargetName(cmTarget const* target)
static std::string getAutogenTargetDir(cmTarget const* target) static std::string getAutogenTargetDir(cmTarget const* target)
{ {
cmMakefile* makefile = target->GetMakefile(); cmMakefile* makefile = target->GetMakefile();
std::string targetDir = makefile->GetCurrentOutputDirectory(); std::string targetDir = makefile->GetCurrentBinaryDirectory();
targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory(); targetDir += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
targetDir += "/"; targetDir += "/";
targetDir += getAutogenTargetName(target); targetDir += getAutogenTargetName(target);
@ -291,7 +291,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
if (target->GetPropertyAsBool("AUTOMOC")) if (target->GetPropertyAsBool("AUTOMOC"))
{ {
std::string automocTargetName = getAutogenTargetName(target); std::string automocTargetName = getAutogenTargetName(target);
std::string mocCppFile = makefile->GetCurrentOutputDirectory(); std::string mocCppFile = makefile->GetCurrentBinaryDirectory();
mocCppFile += "/"; mocCppFile += "/";
mocCppFile += automocTargetName; mocCppFile += automocTargetName;
mocCppFile += ".cpp"; mocCppFile += ".cpp";
@ -317,7 +317,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
commandLines.push_back(currentLine); commandLines.push_back(currentLine);
std::string workingDirectory = cmSystemTools::CollapseFullPath( std::string workingDirectory = cmSystemTools::CollapseFullPath(
"", makefile->GetCurrentOutputDirectory()); "", makefile->GetCurrentBinaryDirectory());
std::vector<std::string> depends; std::vector<std::string> depends;
if (const char *autogenDepends = if (const char *autogenDepends =
@ -1199,9 +1199,9 @@ static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
cmLocalGenerator* lg = gg->CreateLocalGenerator(); cmLocalGenerator* lg = gg->CreateLocalGenerator();
lg->GetMakefile()->SetHomeOutputDirectory(targetDirectory); lg->GetMakefile()->SetHomeOutputDirectory(targetDirectory);
lg->GetMakefile()->SetStartOutputDirectory(targetDirectory); lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
lg->GetMakefile()->SetHomeDirectory(targetDirectory); lg->GetMakefile()->SetHomeDirectory(targetDirectory);
lg->GetMakefile()->SetStartDirectory(targetDirectory); lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
gg->SetCurrentLocalGenerator(lg); gg->SetCurrentLocalGenerator(lg);
return gg; return gg;

View File

@ -86,7 +86,7 @@ void cmSearchPath::AddUserPath(const std::string& path)
for(std::vector<std::string>::const_iterator p = outPaths.begin(); for(std::vector<std::string>::const_iterator p = outPaths.begin();
p != outPaths.end(); ++p) p != outPaths.end(); ++p)
{ {
this->AddPathInternal(*p, this->FC->Makefile->GetCurrentDirectory()); this->AddPathInternal(*p, this->FC->Makefile->GetCurrentSourceDirectory());
} }
} }
@ -104,7 +104,8 @@ void cmSearchPath::AddCMakePath(const std::string& variable)
for(std::vector<std::string>::const_iterator p = expanded.begin(); for(std::vector<std::string>::const_iterator p = expanded.begin();
p!= expanded.end(); ++p) p!= expanded.end(); ++p)
{ {
this->AddPathInternal(*p, this->FC->Makefile->GetCurrentDirectory()); this->AddPathInternal(*p,
this->FC->Makefile->GetCurrentSourceDirectory());
} }
} }
} }
@ -132,7 +133,8 @@ void cmSearchPath::AddCMakePrefixPath(const std::string& variable)
std::vector<std::string> expanded; std::vector<std::string> expanded;
cmSystemTools::ExpandListArgument(value, expanded); cmSystemTools::ExpandListArgument(value, expanded);
this->AddPrefixPaths(expanded, this->FC->Makefile->GetCurrentDirectory()); this->AddPrefixPaths(expanded,
this->FC->Makefile->GetCurrentSourceDirectory());
} }
} }

View File

@ -197,7 +197,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
std::string dir = *this->Names.begin(); std::string dir = *this->Names.begin();
if(!cmSystemTools::FileIsFullPath(dir.c_str())) if(!cmSystemTools::FileIsFullPath(dir.c_str()))
{ {
dir = this->Makefile->GetCurrentDirectory(); dir = this->Makefile->GetCurrentSourceDirectory();
dir += "/"; dir += "/";
dir += *this->Names.begin(); dir += *this->Names.begin();
} }

View File

@ -162,8 +162,8 @@ bool cmSourceFile::FindFullPath(std::string* error)
const char* tryDirs[3] = {0, 0, 0}; const char* tryDirs[3] = {0, 0, 0};
if(this->Location.DirectoryIsAmbiguous()) if(this->Location.DirectoryIsAmbiguous())
{ {
tryDirs[0] = mf->GetCurrentDirectory(); tryDirs[0] = mf->GetCurrentSourceDirectory();
tryDirs[1] = mf->GetCurrentOutputDirectory(); tryDirs[1] = mf->GetCurrentBinaryDirectory();
} }
else else
{ {

View File

@ -93,7 +93,7 @@ void cmSourceFileLocation::DirectoryUseSource()
{ {
this->Directory = this->Directory =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory, this->Makefile->GetCurrentDirectory()); this->Directory, this->Makefile->GetCurrentSourceDirectory());
this->AmbiguousDirectory = false; this->AmbiguousDirectory = false;
} }
} }
@ -106,7 +106,7 @@ void cmSourceFileLocation::DirectoryUseBinary()
{ {
this->Directory = this->Directory =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory, this->Makefile->GetCurrentOutputDirectory()); this->Directory, this->Makefile->GetCurrentBinaryDirectory());
this->AmbiguousDirectory = false; this->AmbiguousDirectory = false;
} }
} }
@ -143,7 +143,7 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name)
// Check the source tree only because a file in the build tree should // Check the source tree only because a file in the build tree should
// be specified by full path at least once. We do not want this // be specified by full path at least once. We do not want this
// detection to depend on whether the project has already been built. // detection to depend on whether the project has already been built.
tryPath = this->Makefile->GetCurrentDirectory(); tryPath = this->Makefile->GetCurrentSourceDirectory();
tryPath += "/"; tryPath += "/";
} }
if(!this->Directory.empty()) if(!this->Directory.empty())
@ -282,10 +282,10 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc)
// Compare possible directory combinations. // Compare possible directory combinations.
std::string const& srcDir = std::string const& srcDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory, this->Makefile->GetCurrentDirectory()); this->Directory, this->Makefile->GetCurrentSourceDirectory());
std::string const& binDir = std::string const& binDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
this->Directory, this->Makefile->GetCurrentOutputDirectory()); this->Directory, this->Makefile->GetCurrentBinaryDirectory());
if(srcDir != loc.Directory && if(srcDir != loc.Directory &&
binDir != loc.Directory) binDir != loc.Directory)
{ {
@ -297,10 +297,10 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc)
// Compare possible directory combinations. // Compare possible directory combinations.
std::string const& srcDir = std::string const& srcDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
loc.Directory, loc.Makefile->GetCurrentDirectory()); loc.Directory, loc.Makefile->GetCurrentSourceDirectory());
std::string const& binDir = std::string const& binDir =
cmSystemTools::CollapseFullPath( cmSystemTools::CollapseFullPath(
loc.Directory, loc.Makefile->GetCurrentOutputDirectory()); loc.Directory, loc.Makefile->GetCurrentBinaryDirectory());
if(srcDir != this->Directory && if(srcDir != this->Directory &&
binDir != this->Directory) binDir != this->Directory)
{ {

View File

@ -81,7 +81,7 @@ bool cmSourceGroupCommand
std::string src = args[i]; std::string src = args[i];
if(!cmSystemTools::FileIsFullPath(src.c_str())) if(!cmSystemTools::FileIsFullPath(src.c_str()))
{ {
src = this->Makefile->GetCurrentDirectory(); src = this->Makefile->GetCurrentSourceDirectory();
src += "/"; src += "/";
src += args[i]; src += args[i];
} }

View File

@ -39,12 +39,12 @@ bool cmSubdirCommand
// if they specified a relative path then compute the full // if they specified a relative path then compute the full
std::string srcPath = std::string srcPath =
std::string(this->Makefile->GetCurrentDirectory()) + std::string(this->Makefile->GetCurrentSourceDirectory()) +
"/" + i->c_str(); "/" + i->c_str();
if (cmSystemTools::FileIsDirectory(srcPath)) if (cmSystemTools::FileIsDirectory(srcPath))
{ {
std::string binPath = std::string binPath =
std::string(this->Makefile->GetCurrentOutputDirectory()) + std::string(this->Makefile->GetCurrentBinaryDirectory()) +
"/" + i->c_str(); "/" + i->c_str();
this->Makefile->AddSubDirectory(srcPath, binPath, this->Makefile->AddSubDirectory(srcPath, binPath,
excludeFromAll, false); excludeFromAll, false);
@ -55,7 +55,7 @@ bool cmSubdirCommand
// we must compute the binPath from the srcPath, we just take the last // we must compute the binPath from the srcPath, we just take the last
// element from the source path and use that // element from the source path and use that
std::string binPath = std::string binPath =
std::string(this->Makefile->GetCurrentOutputDirectory()) + std::string(this->Makefile->GetCurrentBinaryDirectory()) +
"/" + cmSystemTools::GetFilenameName(*i); "/" + cmSystemTools::GetFilenameName(*i);
this->Makefile->AddSubDirectory(*i, binPath, this->Makefile->AddSubDirectory(*i, binPath,
excludeFromAll, false); excludeFromAll, false);

View File

@ -540,7 +540,7 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetSupportDirectory() const std::string cmTarget::GetSupportDirectory() const
{ {
std::string dir = this->Makefile->GetCurrentOutputDirectory(); std::string dir = this->Makefile->GetCurrentBinaryDirectory();
dir += cmake::GetCMakeFilesDirectory(); dir += cmake::GetCMakeFilesDirectory();
dir += "/"; dir += "/";
dir += this->Name; dir += this->Name;
@ -1918,8 +1918,8 @@ void cmTarget::AppendBuildInterfaceIncludes()
if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE")) if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE"))
{ {
const char *binDir = this->Makefile->GetStartOutputDirectory(); const char *binDir = this->Makefile->GetCurrentBinaryDirectory();
const char *srcDir = this->Makefile->GetStartDirectory(); const char *srcDir = this->Makefile->GetCurrentSourceDirectory();
const std::string dirs = std::string(binDir ? binDir : "") const std::string dirs = std::string(binDir ? binDir : "")
+ std::string(binDir ? ";" : "") + std::string(binDir ? ";" : "")
+ std::string(srcDir ? srcDir : ""); + std::string(srcDir ? srcDir : "");
@ -4542,7 +4542,7 @@ bool cmTarget::ComputeOutputDir(const std::string& config,
// specified as a relative path. Treat a relative path as // specified as a relative path. Treat a relative path as
// relative to the current output directory for this makefile. // relative to the current output directory for this makefile.
out = (cmSystemTools::CollapseFullPath out = (cmSystemTools::CollapseFullPath
(out, this->Makefile->GetStartOutputDirectory())); (out, this->Makefile->GetCurrentBinaryDirectory()));
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(!conf.empty()) if(!conf.empty())
@ -4608,7 +4608,7 @@ bool cmTarget::ComputePDBOutputDir(const std::string& kind,
// specified as a relative path. Treat a relative path as // specified as a relative path. Treat a relative path as
// relative to the current output directory for this makefile. // relative to the current output directory for this makefile.
out = (cmSystemTools::CollapseFullPath out = (cmSystemTools::CollapseFullPath
(out, this->Makefile->GetStartOutputDirectory())); (out, this->Makefile->GetCurrentBinaryDirectory()));
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(!conf.empty()) if(!conf.empty())

View File

@ -47,7 +47,8 @@ std::string cmTargetIncludeDirectoriesCommand
{ {
std::string dirs; std::string dirs;
std::string sep; std::string sep;
std::string prefix = this->Makefile->GetStartDirectory() + std::string("/"); std::string prefix =
this->Makefile->GetCurrentSourceDirectory() + std::string("/");
for(std::vector<std::string>::const_iterator it = content.begin(); for(std::vector<std::string>::const_iterator it = content.begin();
it != content.end(); ++it) it != content.end(); ++it)
{ {

View File

@ -75,7 +75,7 @@ bool cmUtilitySourceCommand
// The third argument specifies the relative directory of the source // The third argument specifies the relative directory of the source
// of the utility. // of the utility.
std::string relativeSource = *arg++; std::string relativeSource = *arg++;
std::string utilitySource = this->Makefile->GetCurrentDirectory(); std::string utilitySource = this->Makefile->GetCurrentSourceDirectory();
utilitySource = utilitySource+"/"+relativeSource; utilitySource = utilitySource+"/"+relativeSource;
// If the directory doesn't exist, the source has not been included. // If the directory doesn't exist, the source has not been included.
@ -93,7 +93,7 @@ bool cmUtilitySourceCommand
// The source exists. // The source exists.
std::string cmakeCFGout = std::string cmakeCFGout =
this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR"); this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR");
std::string utilityDirectory = this->Makefile->GetCurrentOutputDirectory(); std::string utilityDirectory = this->Makefile->GetCurrentBinaryDirectory();
std::string exePath; std::string exePath;
if (this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) if (this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"))
{ {

View File

@ -194,7 +194,7 @@ cmVisualStudio10TargetGenerator(cmTarget* target,
this->BuildFileStream = 0; this->BuildFileStream = 0;
this->IsMissingFiles = false; this->IsMissingFiles = false;
this->DefaultArtifactDir = this->DefaultArtifactDir =
this->Makefile->GetStartOutputDirectory() + std::string("/") + this->Makefile->GetCurrentBinaryDirectory() + std::string("/") +
this->LocalGenerator->GetTargetDirectory(*this->Target); this->LocalGenerator->GetTargetDirectory(*this->Target);
} }
@ -297,7 +297,7 @@ void cmVisualStudio10TargetGenerator::Generate()
} }
} }
cmMakefile* mf = this->Target->GetMakefile(); cmMakefile* mf = this->Target->GetMakefile();
std::string path = mf->GetStartOutputDirectory(); std::string path = mf->GetCurrentBinaryDirectory();
path += "/"; path += "/";
path += this->Name; path += this->Name;
path += ".vcxproj"; path += ".vcxproj";
@ -927,7 +927,7 @@ cmVisualStudio10TargetGenerator::ConvertPath(std::string const& path,
{ {
return forceRelative return forceRelative
? cmSystemTools::RelativePath( ? cmSystemTools::RelativePath(
this->Makefile->GetCurrentOutputDirectory(), path.c_str()) this->Makefile->GetCurrentBinaryDirectory(), path.c_str())
: this->LocalGenerator->Convert(path.c_str(), : this->LocalGenerator->Convert(path.c_str(),
cmLocalGenerator::START_OUTPUT, cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::UNCHANGED, cmLocalGenerator::UNCHANGED,
@ -969,7 +969,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
this->AddMissingSourceGroups(groupsUsed, sourceGroups); this->AddMissingSourceGroups(groupsUsed, sourceGroups);
// Write out group file // Write out group file
std::string path = this->Makefile->GetStartOutputDirectory(); std::string path = this->Makefile->GetCurrentBinaryDirectory();
path += "/"; path += "/";
path += this->Name; path += this->Name;
path += ".vcxproj.filters"; path += ".vcxproj.filters";
@ -1430,7 +1430,7 @@ void cmVisualStudio10TargetGenerator::WriteSource(
std::string sourceRel = this->ConvertPath(sf->GetFullPath(), true); std::string sourceRel = this->ConvertPath(sf->GetFullPath(), true);
size_t const maxLen = 250; size_t const maxLen = 250;
if(sf->GetCustomCommand() || if(sf->GetCustomCommand() ||
((strlen(this->Makefile->GetCurrentOutputDirectory()) + 1 + ((strlen(this->Makefile->GetCurrentBinaryDirectory()) + 1 +
sourceRel.length()) <= maxLen)) sourceRel.length()) <= maxLen))
{ {
forceRelative = true; forceRelative = true;
@ -2194,7 +2194,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
{ {
// Look through the sources for AndroidManifest.xml and use // Look through the sources for AndroidManifest.xml and use
// its location as the root source directory. // its location as the root source directory.
std::string rootDir = this->Makefile->GetCurrentDirectory(); std::string rootDir = this->Makefile->GetCurrentSourceDirectory();
{ {
std::vector<cmSourceFile const*> extraSources; std::vector<cmSourceFile const*> extraSources;
this->GeneratorTarget->GetExtraSources(extraSources, ""); this->GeneratorTarget->GetExtraSources(extraSources, "");
@ -2714,7 +2714,7 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences()
} }
else else
{ {
path = mf->GetStartOutputDirectory(); path = mf->GetCurrentBinaryDirectory();
path += "/"; path += "/";
path += dt->GetName(); path += dt->GetName();
path += ".vcxproj"; path += ".vcxproj";
@ -2978,7 +2978,7 @@ void cmVisualStudio10TargetGenerator::WriteMissingFilesWP80()
// For WP80, the manifest needs to be in the same folder as the project // For WP80, the manifest needs to be in the same folder as the project
// this can cause an overwrite problem if projects aren't organized in // this can cause an overwrite problem if projects aren't organized in
// folders // folders
std::string manifestFile = this->Makefile->GetStartOutputDirectory() + std::string manifestFile = this->Makefile->GetCurrentBinaryDirectory() +
std::string("/WMAppManifest.xml"); std::string("/WMAppManifest.xml");
std::string artifactDir = std::string artifactDir =
this->LocalGenerator->GetTargetDirectory(*this->Target); this->LocalGenerator->GetTargetDirectory(*this->Target);

View File

@ -375,11 +375,11 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator()); cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
lg->GetMakefile()->SetHomeOutputDirectory lg->GetMakefile()->SetHomeOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetStartOutputDirectory lg->GetMakefile()->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetHomeDirectory lg->GetMakefile()->SetHomeDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetStartDirectory lg->GetMakefile()->SetCurrentSourceDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
if (this->GetWorkingMode() != NORMAL_MODE) if (this->GetWorkingMode() != NORMAL_MODE)
{ {
@ -405,6 +405,11 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
bool cmake::FindPackage(const std::vector<std::string>& args) bool cmake::FindPackage(const std::vector<std::string>& args)
{ {
this->SetHomeDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
this->SetHomeOutputDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
// if a generator was not yet created, temporarily create one // if a generator was not yet created, temporarily create one
cmGlobalGenerator *gg = new cmGlobalGenerator; cmGlobalGenerator *gg = new cmGlobalGenerator;
gg->SetCMakeInstance(this); gg->SetCMakeInstance(this);
@ -413,13 +418,9 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
// read in the list file to fill the cache // read in the list file to fill the cache
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator()); cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
cmMakefile* mf = lg->GetMakefile(); cmMakefile* mf = lg->GetMakefile();
mf->SetHomeOutputDirectory mf->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
mf->SetStartOutputDirectory mf->SetCurrentSourceDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
mf->SetHomeDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
mf->SetStartDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
mf->SetArgcArgv(args); mf->SetArgcArgv(args);
@ -727,9 +728,6 @@ void cmake::SetArgs(const std::vector<std::string>& args,
this->SetHomeDirectory this->SetHomeDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
} }
this->SetStartDirectory(this->GetHomeDirectory());
this->SetStartOutputDirectory(this->GetHomeOutputDirectory());
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -800,9 +798,7 @@ void cmake::SetDirectoriesFromFile(const char* arg)
if (existingValue) if (existingValue)
{ {
this->SetHomeOutputDirectory(cachePath); this->SetHomeOutputDirectory(cachePath);
this->SetStartOutputDirectory(cachePath);
this->SetHomeDirectory(existingValue); this->SetHomeDirectory(existingValue);
this->SetStartDirectory(existingValue);
return; return;
} }
} }
@ -812,14 +808,12 @@ void cmake::SetDirectoriesFromFile(const char* arg)
if(!listPath.empty()) if(!listPath.empty())
{ {
this->SetHomeDirectory(listPath); this->SetHomeDirectory(listPath);
this->SetStartDirectory(listPath);
if(argIsFile) if(argIsFile)
{ {
// Source CMakeLists.txt file given. It was probably dropped // Source CMakeLists.txt file given. It was probably dropped
// onto the executable in a GUI. Default to an in-source build. // onto the executable in a GUI. Default to an in-source build.
this->SetHomeOutputDirectory(listPath); this->SetHomeOutputDirectory(listPath);
this->SetStartOutputDirectory(listPath);
} }
else else
{ {
@ -827,7 +821,6 @@ void cmake::SetDirectoriesFromFile(const char* arg)
// directory as build tree. // directory as build tree.
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
this->SetHomeOutputDirectory(cwd); this->SetHomeOutputDirectory(cwd);
this->SetStartOutputDirectory(cwd);
} }
return; return;
} }
@ -838,9 +831,7 @@ void cmake::SetDirectoriesFromFile(const char* arg)
std::string full = cmSystemTools::CollapseFullPath(arg); std::string full = cmSystemTools::CollapseFullPath(arg);
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
this->SetHomeDirectory(full); this->SetHomeDirectory(full);
this->SetStartDirectory(full);
this->SetHomeOutputDirectory(cwd); this->SetHomeOutputDirectory(cwd);
this->SetStartOutputDirectory(cwd);
} }
// at the end of this CMAKE_ROOT and CMAKE_COMMAND should be added to the // at the end of this CMAKE_ROOT and CMAKE_COMMAND should be added to the
@ -1005,28 +996,6 @@ const char* cmake::GetHomeOutputDirectory() const
return this->HomeOutputDirectory.c_str(); return this->HomeOutputDirectory.c_str();
} }
const char* cmake::GetStartDirectory() const
{
return this->cmStartDirectory.c_str();
}
void cmake::SetStartDirectory(const std::string& dir)
{
this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
}
const char* cmake::GetStartOutputDirectory() const
{
return this->StartOutputDirectory.c_str();
}
void cmake::SetStartOutputDirectory(const std::string& dir)
{
this->StartOutputDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
}
void cmake::SetGlobalGenerator(cmGlobalGenerator *gg) void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
{ {
if(!gg) if(!gg)
@ -1087,7 +1056,7 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
int cmake::DoPreConfigureChecks() int cmake::DoPreConfigureChecks()
{ {
// Make sure the Start directory contains a CMakeLists.txt file. // Make sure the Source directory contains a CMakeLists.txt file.
std::string srcList = this->GetHomeDirectory(); std::string srcList = this->GetHomeDirectory();
srcList += "/CMakeLists.txt"; srcList += "/CMakeLists.txt";
if(!cmSystemTools::FileExists(srcList.c_str())) if(!cmSystemTools::FileExists(srcList.c_str()))
@ -1189,7 +1158,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
} }
// remove the cache // remove the cache
this->CacheManager->DeleteCache(this->GetStartOutputDirectory()); this->CacheManager->DeleteCache(this->GetHomeOutputDirectory());
// load the empty cache // load the empty cache
this->LoadCache(); this->LoadCache();
// restore the changed compilers // restore the changed compilers
@ -1261,7 +1230,7 @@ int cmake::ActualConfigure()
this->CacheManager->AddCacheEntry this->CacheManager->AddCacheEntry
("CMAKE_HOME_DIRECTORY", ("CMAKE_HOME_DIRECTORY",
this->GetHomeDirectory(), this->GetHomeDirectory(),
"Start directory with the top level CMakeLists.txt file for this " "Source directory with the top level CMakeLists.txt file for this "
"project", "project",
cmState::INTERNAL); cmState::INTERNAL);
} }
@ -1631,12 +1600,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
return 0; return 0;
} }
// If we are doing global generate, we better set start and start
// output directory to the root of the project.
std::string oldstartdir = this->GetStartDirectory();
std::string oldstartoutputdir = this->GetStartOutputDirectory();
this->SetStartDirectory(this->GetHomeDirectory());
this->SetStartOutputDirectory(this->GetHomeOutputDirectory());
int ret = this->Configure(); int ret = this->Configure();
if (ret || this->GetWorkingMode() != NORMAL_MODE) if (ret || this->GetWorkingMode() != NORMAL_MODE)
{ {
@ -1666,8 +1629,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
{ {
return ret; return ret;
} }
this->SetStartDirectory(oldstartdir);
this->SetStartOutputDirectory(oldstartoutputdir);
return ret; return ret;
} }

View File

@ -41,7 +41,7 @@ class cmState;
* The basic process for a GUI is as follows: * The basic process for a GUI is as follows:
* *
* -# Create a cmake instance * -# Create a cmake instance
* -# Set the Home & Start directories, generator, and cmake command. this * -# Set the Home directories, generator, and cmake command. this
* can be done using the Set methods or by using SetArgs and passing in * can be done using the Set methods or by using SetArgs and passing in
* command line arguments. * command line arguments.
* -# Load the cache by calling LoadCache (duh) * -# Load the cache by calling LoadCache (duh)
@ -52,7 +52,7 @@ class cmState;
* -# Let the user change values and go back to step 5 * -# Let the user change values and go back to step 5
* -# call Generate * -# call Generate
* If your GUI allows the user to change the start & home directories then * If your GUI allows the user to change the home directories then
* you must at a minimum redo steps 2 through 7. * you must at a minimum redo steps 2 through 7.
*/ */
@ -106,9 +106,7 @@ class cmake
/** /**
* Set/Get the home directory (or output directory) in the project. The * Set/Get the home directory (or output directory) in the project. The
* home directory is the top directory of the project. It is the * home directory is the top directory of the project. It is the
* path-to-source cmake was run with. Remember that CMake processes * path-to-source cmake was run with.
* CMakeLists files by recursing up the tree starting at the StartDirectory
* and going up until it reaches the HomeDirectory.
*/ */
void SetHomeDirectory(const std::string& dir); void SetHomeDirectory(const std::string& dir);
const char* GetHomeDirectory() const; const char* GetHomeDirectory() const;
@ -116,20 +114,6 @@ class cmake
const char* GetHomeOutputDirectory() const; const char* GetHomeOutputDirectory() const;
//@} //@}
//@{
/**
* Set/Get the start directory (or output directory). The start directory
* is the directory of the CMakeLists.txt file that started the current
* round of processing. Remember that CMake processes CMakeLists files by
* recursing up the tree starting at the StartDirectory and going up until
* it reaches the HomeDirectory.
*/
void SetStartDirectory(const std::string& dir);
const char* GetStartDirectory() const;
void SetStartOutputDirectory(const std::string& dir);
const char* GetStartOutputDirectory() const;
//@}
/** /**
* Handle a command line invocation of cmake. * Handle a command line invocation of cmake.
*/ */
@ -354,8 +338,6 @@ protected:
cmCacheManager *CacheManager; cmCacheManager *CacheManager;
std::string cmHomeDirectory; std::string cmHomeDirectory;
std::string HomeOutputDirectory; std::string HomeOutputDirectory;
std::string cmStartDirectory;
std::string StartOutputDirectory;
bool SuppressDevWarnings; bool SuppressDevWarnings;
bool DoSuppressDevWarnings; bool DoSuppressDevWarnings;
std::string GeneratorPlatform; std::string GeneratorPlatform;

View File

@ -154,12 +154,12 @@ static void cmakemainProgressCallback(const char *m, float prog,
if ((mf) && (strstr(m, "Configuring")==m) && (prog<0)) if ((mf) && (strstr(m, "Configuring")==m) && (prog<0))
{ {
dir = " "; dir = " ";
dir += mf->GetCurrentDirectory(); dir += mf->GetCurrentSourceDirectory();
} }
else if ((mf) && (strstr(m, "Generating")==m)) else if ((mf) && (strstr(m, "Generating")==m))
{ {
dir = " "; dir = " ";
dir += mf->GetCurrentOutputDirectory(); dir += mf->GetCurrentBinaryDirectory();
} }
if ((prog < 0) || (!dir.empty())) if ((prog < 0) || (!dir.empty()))

View File

@ -642,16 +642,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
homeOutDir = cmSystemTools::CollapseFullPath(homeOutDir); homeOutDir = cmSystemTools::CollapseFullPath(homeOutDir);
startOutDir = cmSystemTools::CollapseFullPath(startOutDir); startOutDir = cmSystemTools::CollapseFullPath(startOutDir);
cm.SetHomeDirectory(homeDir); cm.SetHomeDirectory(homeDir);
cm.SetStartDirectory(startDir);
cm.SetHomeOutputDirectory(homeOutDir); cm.SetHomeOutputDirectory(homeOutDir);
cm.SetStartOutputDirectory(startOutDir);
if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen)) if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen))
{ {
cm.SetGlobalGenerator(ggd); cm.SetGlobalGenerator(ggd);
cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator()); cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator());
lgd->GetMakefile()->SetStartDirectory(startDir); lgd->GetMakefile()->SetCurrentSourceDirectory(startDir);
lgd->GetMakefile()->SetStartOutputDirectory(startOutDir); lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir);
lgd->GetMakefile()->MakeStartDirectoriesCurrent();
// Actually scan dependencies. // Actually scan dependencies.
return lgd->UpdateDependencies(depInfo.c_str(), return lgd->UpdateDependencies(depInfo.c_str(),