Merge topic 'global-generator-makefiles'
6d8a125e
cmQtAutoGenerators: Prefer a generator to access global generator.5f66900e
cmGlobalGenerator: Port Find API to cmMakefile.c5b8841f
cmGlobalGenerator: Create global targets from cmMakefiles.8f75ea3b
cmGlobalGenerator: Port global target creation to cmMakefile.56f0540b
cmGlobalGenerator: Port Configure-time check to cmMakefile.19b546ef
cmGlobalGenerator: Base final target property computation on Makefiles.f8be9ba9
cmGlobalGenerator: Base progress on Makefiles, not LocalGenerators.bc1097e3
cmExportLibraryDependenciesCommand: Port to cmMakefile.204aecdf
cmGlobalGenerator: Port configure-time code to cmMakefile.3dd6f0a5
cmake: Port configure-time code to cmMakefile.73e4df99
cmGlobalGenerator: Store a container of cmMakefiles.19369937
cmGeneratorTarget: Port internal type to cmGeneratorTarget.32f131b0
cmGeneratorTarget: Prefer the local generator to access the global.
This commit is contained in:
commit
9e51147646
|
@ -11,7 +11,6 @@
|
||||||
============================================================================*/
|
============================================================================*/
|
||||||
#include "cmExportLibraryDependenciesCommand.h"
|
#include "cmExportLibraryDependenciesCommand.h"
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
#include "cmLocalGenerator.h"
|
|
||||||
#include "cmGeneratedFileStream.h"
|
#include "cmGeneratedFileStream.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
#include "cmVersion.h"
|
#include "cmVersion.h"
|
||||||
|
@ -82,15 +81,14 @@ void cmExportLibraryDependenciesCommand::ConstFinalPass() const
|
||||||
// the project.
|
// the project.
|
||||||
cmake* cm = this->Makefile->GetCMakeInstance();
|
cmake* cm = this->Makefile->GetCMakeInstance();
|
||||||
cmGlobalGenerator* global = cm->GetGlobalGenerator();
|
cmGlobalGenerator* global = cm->GetGlobalGenerator();
|
||||||
const std::vector<cmLocalGenerator *>& locals = global->GetLocalGenerators();
|
const std::vector<cmMakefile*>& locals = global->GetMakefiles();
|
||||||
std::map<std::string, std::string> libDepsOld;
|
std::map<std::string, std::string> libDepsOld;
|
||||||
std::map<std::string, std::string> libDepsNew;
|
std::map<std::string, std::string> libDepsNew;
|
||||||
std::map<std::string, std::string> libTypes;
|
std::map<std::string, std::string> libTypes;
|
||||||
for(std::vector<cmLocalGenerator *>::const_iterator i = locals.begin();
|
for(std::vector<cmMakefile*>::const_iterator i = locals.begin();
|
||||||
i != locals.end(); ++i)
|
i != locals.end(); ++i)
|
||||||
{
|
{
|
||||||
const cmLocalGenerator* gen = *i;
|
const cmTargets &tgts = (*i)->GetTargets();
|
||||||
const cmTargets &tgts = gen->GetMakefile()->GetTargets();
|
|
||||||
for(cmTargets::const_iterator l = tgts.begin();
|
for(cmTargets::const_iterator l = tgts.begin();
|
||||||
l != tgts.end(); ++l)
|
l != tgts.end(); ++l)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
|
void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
|
||||||
cmTarget *target, cmake *cm)
|
cmGeneratorTarget const* target, cmake *cm)
|
||||||
{
|
{
|
||||||
if(!badObjLib.empty())
|
if(!badObjLib.empty())
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
|
||||||
e << "but may contain only sources that compile, header files, and "
|
e << "but may contain only sources that compile, header files, and "
|
||||||
"other files that would not affect linking of a normal library.";
|
"other files that would not affect linking of a normal library.";
|
||||||
cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
|
cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
|
||||||
target->GetBacktrace());
|
target->Target->GetBacktrace());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,14 +133,14 @@ struct TagVisitor
|
||||||
{
|
{
|
||||||
DataType& Data;
|
DataType& Data;
|
||||||
std::vector<cmSourceFile*> BadObjLibFiles;
|
std::vector<cmSourceFile*> BadObjLibFiles;
|
||||||
cmTarget *Target;
|
cmGeneratorTarget const* Target;
|
||||||
cmGlobalGenerator *GlobalGenerator;
|
cmGlobalGenerator *GlobalGenerator;
|
||||||
cmsys::RegularExpression Header;
|
cmsys::RegularExpression Header;
|
||||||
bool IsObjLib;
|
bool IsObjLib;
|
||||||
|
|
||||||
TagVisitor(cmTarget *target, DataType& data)
|
TagVisitor(cmGeneratorTarget const* target, DataType& data)
|
||||||
: Data(data), Target(target),
|
: Data(data), Target(target),
|
||||||
GlobalGenerator(target->GetMakefile()->GetGlobalGenerator()),
|
GlobalGenerator(target->GetLocalGenerator()->GetGlobalGenerator()),
|
||||||
Header(CM_HEADER_REGEX),
|
Header(CM_HEADER_REGEX),
|
||||||
IsObjLib(target->GetType() == cmTarget::OBJECT_LIBRARY)
|
IsObjLib(target->GetType() == cmTarget::OBJECT_LIBRARY)
|
||||||
{
|
{
|
||||||
|
@ -234,7 +234,7 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t, cmLocalGenerator* lg)
|
||||||
{
|
{
|
||||||
this->Makefile = this->Target->GetMakefile();
|
this->Makefile = this->Target->GetMakefile();
|
||||||
this->LocalGenerator = lg;
|
this->LocalGenerator = lg;
|
||||||
this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
|
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmGeneratorTarget::~cmGeneratorTarget()
|
cmGeneratorTarget::~cmGeneratorTarget()
|
||||||
|
@ -362,7 +362,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, cmTarget const* depTgt,
|
||||||
{ \
|
{ \
|
||||||
std::vector<cmSourceFile*> sourceFiles; \
|
std::vector<cmSourceFile*> sourceFiles; \
|
||||||
this->Target->GetSourceFiles(sourceFiles, config); \
|
this->Target->GetSourceFiles(sourceFiles, config); \
|
||||||
TagVisitor<DATA ## Tag DATATYPE> visitor(this->Target, data); \
|
TagVisitor<DATA ## Tag DATATYPE> visitor(this, data); \
|
||||||
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
|
for(std::vector<cmSourceFile*>::const_iterator si = sourceFiles.begin(); \
|
||||||
si != sourceFiles.end(); ++si) \
|
si != sourceFiles.end(); ++si) \
|
||||||
{ \
|
{ \
|
||||||
|
@ -1557,7 +1557,7 @@ cmTargetTraceDependencies
|
||||||
{
|
{
|
||||||
// Convenience.
|
// Convenience.
|
||||||
this->Makefile = this->Target->GetMakefile();
|
this->Makefile = this->Target->GetMakefile();
|
||||||
this->GlobalGenerator = this->Makefile->GetGlobalGenerator();
|
this->GlobalGenerator = target->GetLocalGenerator()->GetGlobalGenerator();
|
||||||
this->CurrentEntry = 0;
|
this->CurrentEntry = 0;
|
||||||
|
|
||||||
// Queue all the source files already specified for the target.
|
// Queue all the source files already specified for the target.
|
||||||
|
@ -1945,8 +1945,7 @@ void cmGeneratorTarget::GenerateTargetManifest(
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmMakefile* mf = this->Target->GetMakefile();
|
cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator();
|
||||||
cmGlobalGenerator* gg = mf->GetGlobalGenerator();
|
|
||||||
|
|
||||||
// Get the names.
|
// Get the names.
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
|
@ -51,10 +51,8 @@ bool cmGetDirectoryPropertyCommand
|
||||||
sd = cmSystemTools::CollapseFullPath(sd);
|
sd = cmSystemTools::CollapseFullPath(sd);
|
||||||
|
|
||||||
// lookup the makefile from the directory name
|
// lookup the makefile from the directory name
|
||||||
cmLocalGenerator *lg =
|
dir = this->Makefile->GetGlobalGenerator()->FindMakefile(sd);
|
||||||
this->Makefile->GetGlobalGenerator()->
|
if (!dir)
|
||||||
FindLocalGenerator(sd);
|
|
||||||
if (!lg)
|
|
||||||
{
|
{
|
||||||
this->SetError
|
this->SetError
|
||||||
("DIRECTORY argument provided but requested directory not found. "
|
("DIRECTORY argument provided but requested directory not found. "
|
||||||
|
@ -62,7 +60,6 @@ bool cmGetDirectoryPropertyCommand
|
||||||
"it is valid but has not been processed yet.");
|
"it is valid but has not been processed yet.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
dir = lg->GetMakefile();
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,13 +262,8 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
|
||||||
dir = cmSystemTools::CollapseFullPath(dir);
|
dir = cmSystemTools::CollapseFullPath(dir);
|
||||||
|
|
||||||
// Lookup the generator.
|
// Lookup the generator.
|
||||||
if(cmLocalGenerator* lg =
|
mf = this->Makefile->GetGlobalGenerator()->FindMakefile(dir);
|
||||||
(this->Makefile->GetGlobalGenerator()->FindLocalGenerator(dir)))
|
if (!mf)
|
||||||
{
|
|
||||||
// Use the makefile for the directory found.
|
|
||||||
mf = lg->GetMakefile();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Could not find the directory.
|
// Could not find the directory.
|
||||||
this->SetError
|
this->SetError
|
||||||
|
|
|
@ -1129,6 +1129,7 @@ void cmGlobalGenerator::Configure()
|
||||||
|
|
||||||
// start with this directory
|
// start with this directory
|
||||||
cmLocalGenerator *lg = this->MakeLocalGenerator();
|
cmLocalGenerator *lg = this->MakeLocalGenerator();
|
||||||
|
this->Makefiles.push_back(lg->GetMakefile());
|
||||||
this->LocalGenerators.push_back(lg);
|
this->LocalGenerators.push_back(lg);
|
||||||
|
|
||||||
// set the Start directories
|
// set the Start directories
|
||||||
|
@ -1147,9 +1148,9 @@ void cmGlobalGenerator::Configure()
|
||||||
// update the cache entry for the number of local generators, this is used
|
// update the cache entry for the number of local generators, this is used
|
||||||
// for progress
|
// for progress
|
||||||
char num[100];
|
char num[100];
|
||||||
sprintf(num,"%d",static_cast<int>(this->LocalGenerators.size()));
|
sprintf(num,"%d",static_cast<int>(this->Makefiles.size()));
|
||||||
this->GetCMakeInstance()->AddCacheEntry
|
this->GetCMakeInstance()->AddCacheEntry
|
||||||
("CMAKE_NUMBER_OF_LOCAL_GENERATORS", num,
|
("CMAKE_NUMBER_OF_MAKEFILES", num,
|
||||||
"number of local generators", cmState::INTERNAL);
|
"number of local generators", cmState::INTERNAL);
|
||||||
|
|
||||||
// check for link libraries and include directories containing "NOTFOUND"
|
// check for link libraries and include directories containing "NOTFOUND"
|
||||||
|
@ -1192,9 +1193,9 @@ void cmGlobalGenerator::Configure()
|
||||||
cmTargets globalTargets;
|
cmTargets globalTargets;
|
||||||
this->CreateDefaultGlobalTargets(&globalTargets);
|
this->CreateDefaultGlobalTargets(&globalTargets);
|
||||||
|
|
||||||
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
for (i = 0; i < this->Makefiles.size(); ++i)
|
||||||
{
|
{
|
||||||
cmMakefile* mf = this->LocalGenerators[i]->GetMakefile();
|
cmMakefile* mf = this->Makefiles[i];
|
||||||
cmTargets* targets = &(mf->GetTargets());
|
cmTargets* targets = &(mf->GetTargets());
|
||||||
cmTargets::iterator tit;
|
cmTargets::iterator tit;
|
||||||
for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
|
for ( tit = globalTargets.begin(); tit != globalTargets.end(); ++ tit )
|
||||||
|
@ -1481,9 +1482,9 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
|
||||||
void cmGlobalGenerator::FinalizeTargetCompileInfo()
|
void cmGlobalGenerator::FinalizeTargetCompileInfo()
|
||||||
{
|
{
|
||||||
// Construct per-target generator information.
|
// Construct per-target generator information.
|
||||||
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
|
for(unsigned int i=0; i < this->Makefiles.size(); ++i)
|
||||||
{
|
{
|
||||||
cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
|
cmMakefile *mf = this->Makefiles[i];
|
||||||
|
|
||||||
const cmStringRange noconfig_compile_definitions =
|
const cmStringRange noconfig_compile_definitions =
|
||||||
mf->GetCompileDefinitionsEntries();
|
mf->GetCompileDefinitionsEntries();
|
||||||
|
@ -1600,6 +1601,8 @@ void cmGlobalGenerator::ClearGeneratorMembers()
|
||||||
cmDeleteAll(this->BuildExportSets);
|
cmDeleteAll(this->BuildExportSets);
|
||||||
this->BuildExportSets.clear();
|
this->BuildExportSets.clear();
|
||||||
|
|
||||||
|
this->Makefiles.clear();
|
||||||
|
|
||||||
cmDeleteAll(this->LocalGenerators);
|
cmDeleteAll(this->LocalGenerators);
|
||||||
this->LocalGenerators.clear();
|
this->LocalGenerators.clear();
|
||||||
|
|
||||||
|
@ -1639,11 +1642,11 @@ void cmGlobalGenerator::CheckLocalGenerators()
|
||||||
// std::set<std::string> notFoundMap;
|
// std::set<std::string> notFoundMap;
|
||||||
// after it is all done do a ConfigureFinalPass
|
// after it is all done do a ConfigureFinalPass
|
||||||
cmState* state = this->GetCMakeInstance()->GetState();
|
cmState* state = this->GetCMakeInstance()->GetState();
|
||||||
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
for (unsigned int i = 0; i < this->Makefiles.size(); ++i)
|
||||||
{
|
{
|
||||||
this->LocalGenerators[i]->GetMakefile()->ConfigureFinalPass();
|
this->Makefiles[i]->ConfigureFinalPass();
|
||||||
cmTargets &targets =
|
cmTargets &targets =
|
||||||
this->LocalGenerators[i]->GetMakefile()->GetTargets();
|
this->Makefiles[i]->GetTargets();
|
||||||
for (cmTargets::iterator l = targets.begin();
|
for (cmTargets::iterator l = targets.begin();
|
||||||
l != targets.end(); l++)
|
l != targets.end(); l++)
|
||||||
{
|
{
|
||||||
|
@ -1698,15 +1701,14 @@ 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->Makefiles[i]->GetCurrentSourceDirectory();
|
||||||
->GetMakefile()->GetCurrentSourceDirectory();
|
|
||||||
notFoundMap[varName] = text;
|
notFoundMap[varName] = text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->CMakeInstance->UpdateProgress
|
this->CMakeInstance->UpdateProgress
|
||||||
("Configuring", 0.9f+0.1f*(static_cast<float>(i)+1.0f)/
|
("Configuring", 0.9f+0.1f*(static_cast<float>(i)+1.0f)/
|
||||||
static_cast<float>(this->LocalGenerators.size()));
|
static_cast<float>(this->Makefiles.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!notFoundMap.empty())
|
if(!notFoundMap.empty())
|
||||||
|
@ -1740,9 +1742,9 @@ int cmGlobalGenerator::TryCompile(const std::string& srcdir,
|
||||||
// take the bulk of the time, so try and guess some progress
|
// take the bulk of the time, so try and guess some progress
|
||||||
// by getting closer and closer to 100 without actually getting there.
|
// by getting closer and closer to 100 without actually getting there.
|
||||||
if (!this->CMakeInstance->GetState()->GetInitializedCacheValue
|
if (!this->CMakeInstance->GetState()->GetInitializedCacheValue
|
||||||
("CMAKE_NUMBER_OF_LOCAL_GENERATORS"))
|
("CMAKE_NUMBER_OF_MAKEFILES"))
|
||||||
{
|
{
|
||||||
// If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set
|
// If CMAKE_NUMBER_OF_MAKEFILES is not set
|
||||||
// we are in the first time progress and we have no
|
// we are in the first time progress and we have no
|
||||||
// idea how long it will be. So, just move 1/10th of the way
|
// idea how long it will be. So, just move 1/10th of the way
|
||||||
// there each time, and don't go over 95%
|
// there each time, and don't go over 95%
|
||||||
|
@ -1930,19 +1932,19 @@ std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
|
void cmGlobalGenerator::AddMakefile(cmMakefile *mf)
|
||||||
{
|
{
|
||||||
this->LocalGenerators.push_back(lg);
|
this->Makefiles.push_back(mf);
|
||||||
|
|
||||||
// update progress
|
// update progress
|
||||||
// estimate how many lg there will be
|
// estimate how many lg there will be
|
||||||
const char *numGenC =
|
const char *numGenC =
|
||||||
this->CMakeInstance->GetState()->GetInitializedCacheValue
|
this->CMakeInstance->GetState()->GetInitializedCacheValue
|
||||||
("CMAKE_NUMBER_OF_LOCAL_GENERATORS");
|
("CMAKE_NUMBER_OF_MAKEFILES");
|
||||||
|
|
||||||
if (!numGenC)
|
if (!numGenC)
|
||||||
{
|
{
|
||||||
// If CMAKE_NUMBER_OF_LOCAL_GENERATORS is not set
|
// If CMAKE_NUMBER_OF_MAKEFILES is not set
|
||||||
// we are in the first time progress and we have no
|
// we are in the first time progress and we have no
|
||||||
// idea how long it will be. So, just move half way
|
// idea how long it will be. So, just move half way
|
||||||
// there each time, and don't go over 95%
|
// there each time, and don't go over 95%
|
||||||
|
@ -1957,7 +1959,7 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
|
||||||
}
|
}
|
||||||
|
|
||||||
int numGen = atoi(numGenC);
|
int numGen = atoi(numGenC);
|
||||||
float prog = 0.9f*static_cast<float>(this->LocalGenerators.size())/
|
float prog = 0.9f*static_cast<float>(this->Makefiles.size())/
|
||||||
static_cast<float>(numGen);
|
static_cast<float>(numGen);
|
||||||
if (prog > 0.9f)
|
if (prog > 0.9f)
|
||||||
{
|
{
|
||||||
|
@ -1966,6 +1968,12 @@ void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
|
||||||
this->CMakeInstance->UpdateProgress("Configuring", prog);
|
this->CMakeInstance->UpdateProgress("Configuring", prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
|
||||||
|
{
|
||||||
|
this->LocalGenerators.push_back(lg);
|
||||||
|
}
|
||||||
|
|
||||||
void cmGlobalGenerator::AddInstallComponent(const char* component)
|
void cmGlobalGenerator::AddInstallComponent(const char* component)
|
||||||
{
|
{
|
||||||
if(component && *component)
|
if(component && *component)
|
||||||
|
@ -2154,6 +2162,20 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmMakefile*
|
||||||
|
cmGlobalGenerator::FindMakefile(const std::string& start_dir) const
|
||||||
|
{
|
||||||
|
for(std::vector<cmMakefile*>::const_iterator it =
|
||||||
|
this->Makefiles.begin(); it != this->Makefiles.end(); ++it)
|
||||||
|
{
|
||||||
|
std::string sd = (*it)->GetCurrentSourceDirectory();
|
||||||
|
if (sd == start_dir)
|
||||||
|
{
|
||||||
|
return *it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
///! Find a local generator by its startdirectory
|
///! Find a local generator by its startdirectory
|
||||||
cmLocalGenerator*
|
cmLocalGenerator*
|
||||||
|
@ -2241,7 +2263,7 @@ inline std::string removeQuotes(const std::string& s)
|
||||||
|
|
||||||
void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
||||||
{
|
{
|
||||||
cmMakefile* mf = this->LocalGenerators[0]->GetMakefile();
|
cmMakefile* mf = this->Makefiles[0];
|
||||||
const char* cmakeCfgIntDir = this->GetCMakeCFGIntDir();
|
const char* cmakeCfgIntDir = this->GetCMakeCFGIntDir();
|
||||||
|
|
||||||
// CPack
|
// CPack
|
||||||
|
@ -2814,9 +2836,9 @@ cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shorten the output name (in expected use case).
|
// Shorten the output name (in expected use case).
|
||||||
cmLocalGenerator* lg = this->GetLocalGenerators()[0];
|
cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
|
||||||
std::string fname = lg->Convert(outputs[0],
|
std::string fname = converter.Convert(
|
||||||
cmLocalGenerator::HOME_OUTPUT);
|
outputs[0], cmLocalGenerator::HOME_OUTPUT);
|
||||||
|
|
||||||
// Associate the hash with this output.
|
// Associate the hash with this output.
|
||||||
this->RuleHashes[fname] = hash;
|
this->RuleHashes[fname] = hash;
|
||||||
|
|
|
@ -173,6 +173,8 @@ public:
|
||||||
cmake *GetCMakeInstance() const { return this->CMakeInstance; }
|
cmake *GetCMakeInstance() const { return this->CMakeInstance; }
|
||||||
|
|
||||||
void SetConfiguredFilesPath(cmGlobalGenerator* gen);
|
void SetConfiguredFilesPath(cmGlobalGenerator* gen);
|
||||||
|
const std::vector<cmMakefile*>& GetMakefiles() const {
|
||||||
|
return this->Makefiles;}
|
||||||
const std::vector<cmLocalGenerator *>& GetLocalGenerators() const {
|
const std::vector<cmLocalGenerator *>& GetLocalGenerators() const {
|
||||||
return this->LocalGenerators;}
|
return this->LocalGenerators;}
|
||||||
|
|
||||||
|
@ -184,6 +186,7 @@ public:
|
||||||
void SetCurrentMakefile(cmMakefile* mf)
|
void SetCurrentMakefile(cmMakefile* mf)
|
||||||
{this->CurrentMakefile = mf;}
|
{this->CurrentMakefile = mf;}
|
||||||
|
|
||||||
|
void AddMakefile(cmMakefile *mf);
|
||||||
void AddLocalGenerator(cmLocalGenerator *lg);
|
void AddLocalGenerator(cmLocalGenerator *lg);
|
||||||
|
|
||||||
///! Set an generator for an "external makefile based project"
|
///! Set an generator for an "external makefile based project"
|
||||||
|
@ -253,6 +256,7 @@ public:
|
||||||
that is a framework. */
|
that is a framework. */
|
||||||
bool NameResolvesToFramework(const std::string& libname) const;
|
bool NameResolvesToFramework(const std::string& libname) const;
|
||||||
|
|
||||||
|
cmMakefile* FindMakefile(const std::string& start_dir) const;
|
||||||
///! Find a local generator by its startdirectory
|
///! Find a local generator by its startdirectory
|
||||||
cmLocalGenerator* FindLocalGenerator(const std::string& start_dir) const;
|
cmLocalGenerator* FindLocalGenerator(const std::string& start_dir) const;
|
||||||
|
|
||||||
|
@ -404,6 +408,7 @@ protected:
|
||||||
std::string FindMakeProgramFile;
|
std::string FindMakeProgramFile;
|
||||||
std::string ConfiguredFilesPath;
|
std::string ConfiguredFilesPath;
|
||||||
cmake *CMakeInstance;
|
cmake *CMakeInstance;
|
||||||
|
std::vector<cmMakefile*> Makefiles;
|
||||||
std::vector<cmLocalGenerator *> LocalGenerators;
|
std::vector<cmLocalGenerator *> LocalGenerators;
|
||||||
cmMakefile* CurrentMakefile;
|
cmMakefile* CurrentMakefile;
|
||||||
// map from project name to vector of local generators in that project
|
// map from project name to vector of local generators in that project
|
||||||
|
|
|
@ -1857,6 +1857,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
|
||||||
// create a new local generator and set its parent
|
// create a new local generator and set its parent
|
||||||
cmLocalGenerator *lg2 = this->GetGlobalGenerator()
|
cmLocalGenerator *lg2 = this->GetGlobalGenerator()
|
||||||
->MakeLocalGenerator(newSnapshot, this->LocalGenerator);
|
->MakeLocalGenerator(newSnapshot, this->LocalGenerator);
|
||||||
|
this->GetGlobalGenerator()->AddMakefile(lg2->GetMakefile());
|
||||||
this->GetGlobalGenerator()->AddLocalGenerator(lg2);
|
this->GetGlobalGenerator()->AddLocalGenerator(lg2);
|
||||||
|
|
||||||
cmMakefile* subMf = lg2->GetMakefile();
|
cmMakefile* subMf = lg2->GetMakefile();
|
||||||
|
|
|
@ -369,7 +369,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
bool usePRE_BUILD = false;
|
bool usePRE_BUILD = false;
|
||||||
cmGlobalGenerator* gg = makefile->GetGlobalGenerator();
|
cmGlobalGenerator* gg = lg->GetGlobalGenerator();
|
||||||
if(gg->GetName().find("Visual Studio") != std::string::npos)
|
if(gg->GetName().find("Visual Studio") != std::string::npos)
|
||||||
{
|
{
|
||||||
cmGlobalVisualStudioGenerator* vsgg =
|
cmGlobalVisualStudioGenerator* vsgg =
|
||||||
|
@ -396,7 +396,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmLocalGenerator* lg,
|
||||||
|
|
||||||
std::vector<std::string> rcc_output;
|
std::vector<std::string> rcc_output;
|
||||||
bool const isNinja =
|
bool const isNinja =
|
||||||
makefile->GetGlobalGenerator()->GetName() == "Ninja";
|
lg->GetGlobalGenerator()->GetName() == "Ninja";
|
||||||
if(isNinja
|
if(isNinja
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|| usePRE_BUILD
|
|| usePRE_BUILD
|
||||||
|
|
|
@ -205,14 +205,8 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
|
||||||
// The local generators are associated with collapsed paths.
|
// The local generators are associated with collapsed paths.
|
||||||
dir = cmSystemTools::CollapseFullPath(dir);
|
dir = cmSystemTools::CollapseFullPath(dir);
|
||||||
|
|
||||||
// Lookup the generator.
|
mf = this->Makefile->GetGlobalGenerator()->FindMakefile(dir);
|
||||||
if(cmLocalGenerator* lg =
|
if (!mf)
|
||||||
this->Makefile->GetGlobalGenerator()->FindLocalGenerator(dir))
|
|
||||||
{
|
|
||||||
// Use the makefile for the directory found.
|
|
||||||
mf = lg->GetMakefile();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Could not find the directory.
|
// Could not find the directory.
|
||||||
this->SetError
|
this->SetError
|
||||||
|
|
|
@ -1592,7 +1592,7 @@ int cmake::ActualConfigure()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
cmMakefile* mf=this->GlobalGenerator->GetMakefiles()[0];
|
||||||
if (mf->IsOn("CTEST_USE_LAUNCHERS")
|
if (mf->IsOn("CTEST_USE_LAUNCHERS")
|
||||||
&& !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE"))
|
&& !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue