parent
3c245ab2ba
commit
7b1421b885
|
@ -23,7 +23,7 @@
|
||||||
#include <cmsys/SystemTools.hxx>
|
#include <cmsys/SystemTools.hxx>
|
||||||
|
|
||||||
/* Some useful URLs:
|
/* Some useful URLs:
|
||||||
Homepage:
|
Homepage:
|
||||||
http://www.codeblocks.org
|
http://www.codeblocks.org
|
||||||
|
|
||||||
File format docs:
|
File format docs:
|
||||||
|
@ -107,7 +107,7 @@ void cmExtraCodeBlocksGenerator::CreateProjectFile(
|
||||||
/* Tree is used to create a "Virtual Folder" in CodeBlocks, in which all
|
/* Tree is used to create a "Virtual Folder" in CodeBlocks, in which all
|
||||||
CMake files this project depends on will be put. This means additionally
|
CMake files this project depends on will be put. This means additionally
|
||||||
to the "Sources" and "Headers" virtual folders of CodeBlocks, there will
|
to the "Sources" and "Headers" virtual folders of CodeBlocks, there will
|
||||||
now also be a "CMake Files" virtual folder.
|
now also be a "CMake Files" virtual folder.
|
||||||
Patch by Daniel Teske <daniel.teske AT nokia.com> (which use C::B project
|
Patch by Daniel Teske <daniel.teske AT nokia.com> (which use C::B project
|
||||||
files in QtCreator).*/
|
files in QtCreator).*/
|
||||||
struct Tree
|
struct Tree
|
||||||
|
@ -115,24 +115,24 @@ struct Tree
|
||||||
std::string path; //only one component of the path
|
std::string path; //only one component of the path
|
||||||
std::vector<Tree> folders;
|
std::vector<Tree> folders;
|
||||||
std::vector<std::string> files;
|
std::vector<std::string> files;
|
||||||
void InsertPath(const std::vector<std::string>& splitted,
|
void InsertPath(const std::vector<std::string>& splitted,
|
||||||
std::vector<std::string>::size_type start,
|
std::vector<std::string>::size_type start,
|
||||||
const std::string& fileName);
|
const std::string& fileName);
|
||||||
void BuildVirtualFolder(std::string& virtualFolders) const;
|
void BuildVirtualFolder(std::string& virtualFolders) const;
|
||||||
void BuildVirtualFolderImpl(std::string& virtualFolders,
|
void BuildVirtualFolderImpl(std::string& virtualFolders,
|
||||||
const std::string& prefix) const;
|
const std::string& prefix) const;
|
||||||
void BuildUnit(std::string& unitString, const std::string& fsPath) const;
|
void BuildUnit(std::string& unitString, const std::string& fsPath) const;
|
||||||
void BuildUnitImpl(std::string& unitString,
|
void BuildUnitImpl(std::string& unitString,
|
||||||
const std::string& virtualFolderPath,
|
const std::string& virtualFolderPath,
|
||||||
const std::string& fsPath) const;
|
const std::string& fsPath) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void Tree::InsertPath(const std::vector<std::string>& splitted,
|
void Tree::InsertPath(const std::vector<std::string>& splitted,
|
||||||
std::vector<std::string>::size_type start,
|
std::vector<std::string>::size_type start,
|
||||||
const std::string& fileName)
|
const std::string& fileName)
|
||||||
{
|
{
|
||||||
if (start == splitted.size())
|
if (start == splitted.size())
|
||||||
{
|
{
|
||||||
files.push_back(fileName);
|
files.push_back(fileName);
|
||||||
return;
|
return;
|
||||||
|
@ -301,7 +301,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now build a virtual tree string
|
// Now build a virtual tree string
|
||||||
std::string virtualFolders;
|
std::string virtualFolders;
|
||||||
tree.BuildVirtualFolder(virtualFolders);
|
tree.BuildVirtualFolder(virtualFolders);
|
||||||
// And one for <Unit>
|
// And one for <Unit>
|
||||||
std::string unitFiles;
|
std::string unitFiles;
|
||||||
|
@ -323,7 +323,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
|
|
||||||
this->AppendTarget(fout, "all", 0, make.c_str(), mf, compiler.c_str());
|
this->AppendTarget(fout, "all", 0, make.c_str(), mf, compiler.c_str());
|
||||||
|
|
||||||
// add all executable and library targets and some of the GLOBAL
|
// add all executable and library targets and some of the GLOBAL
|
||||||
// and UTILITY targets
|
// and UTILITY targets
|
||||||
for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
|
for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
|
||||||
lg!=lgs.end(); lg++)
|
lg!=lgs.end(); lg++)
|
||||||
|
@ -338,9 +338,9 @@ void cmExtraCodeBlocksGenerator
|
||||||
case cmTarget::GLOBAL_TARGET:
|
case cmTarget::GLOBAL_TARGET:
|
||||||
{
|
{
|
||||||
bool insertTarget = false;
|
bool insertTarget = false;
|
||||||
// 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->GetStartOutputDirectory(),
|
||||||
makefile->GetHomeOutputDirectory())==0)
|
makefile->GetHomeOutputDirectory())==0)
|
||||||
{
|
{
|
||||||
insertTarget = true;
|
insertTarget = true;
|
||||||
|
@ -362,7 +362,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
}
|
}
|
||||||
if (insertTarget)
|
if (insertTarget)
|
||||||
{
|
{
|
||||||
this->AppendTarget(fout, ti->first.c_str(), 0,
|
this->AppendTarget(fout, ti->first.c_str(), 0,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), makefile, compiler.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -372,13 +372,13 @@ void cmExtraCodeBlocksGenerator
|
||||||
// Experimental-"sub"targets as e.g. NightlyStart
|
// Experimental-"sub"targets as e.g. NightlyStart
|
||||||
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
|
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
|
||||||
|| ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
|
|| ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
|
||||||
|| ((ti->first.find("Experimental")==0)
|
|| ((ti->first.find("Experimental")==0)
|
||||||
&& (ti->first!="Experimental")))
|
&& (ti->first!="Experimental")))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->AppendTarget(fout, ti->first.c_str(), 0,
|
this->AppendTarget(fout, ti->first.c_str(), 0,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), makefile, compiler.c_str());
|
||||||
break;
|
break;
|
||||||
case cmTarget::EXECUTABLE:
|
case cmTarget::EXECUTABLE:
|
||||||
|
@ -386,11 +386,11 @@ void cmExtraCodeBlocksGenerator
|
||||||
case cmTarget::SHARED_LIBRARY:
|
case cmTarget::SHARED_LIBRARY:
|
||||||
case cmTarget::MODULE_LIBRARY:
|
case cmTarget::MODULE_LIBRARY:
|
||||||
{
|
{
|
||||||
this->AppendTarget(fout, ti->first.c_str(), &ti->second,
|
this->AppendTarget(fout, ti->first.c_str(), &ti->second,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), makefile, compiler.c_str());
|
||||||
std::string fastTarget = ti->first;
|
std::string fastTarget = ti->first;
|
||||||
fastTarget += "/fast";
|
fastTarget += "/fast";
|
||||||
this->AppendTarget(fout, fastTarget.c_str(), &ti->second,
|
this->AppendTarget(fout, fastTarget.c_str(), &ti->second,
|
||||||
make.c_str(), makefile, compiler.c_str());
|
make.c_str(), makefile, compiler.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -437,7 +437,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
{
|
{
|
||||||
for(std::vector<std::string>::const_iterator
|
for(std::vector<std::string>::const_iterator
|
||||||
ext = mf->GetSourceExtensions().begin();
|
ext = mf->GetSourceExtensions().begin();
|
||||||
ext != mf->GetSourceExtensions().end();
|
ext != mf->GetSourceExtensions().end();
|
||||||
++ext)
|
++ext)
|
||||||
{
|
{
|
||||||
if ((*si)->GetExtension() == *ext)
|
if ((*si)->GetExtension() == *ext)
|
||||||
|
@ -467,11 +467,11 @@ void cmExtraCodeBlocksGenerator
|
||||||
|
|
||||||
// The following loop tries to add header files matching to implementation
|
// The following loop tries to add header files matching to implementation
|
||||||
// files to the project. It does that by iterating over all source files,
|
// files to the project. It does that by iterating over all source files,
|
||||||
// replacing the file name extension with ".h" and checks whether such a
|
// replacing the file name extension with ".h" and checks whether such a
|
||||||
// file exists. If it does, it is inserted into the map of files.
|
// file exists. If it does, it is inserted into the map of files.
|
||||||
// A very similar version of that code exists also in the kdevelop
|
// A very similar version of that code exists also in the kdevelop
|
||||||
// project generator.
|
// project generator.
|
||||||
for (std::map<std::string, cmSourceFile*>::const_iterator
|
for (std::map<std::string, cmSourceFile*>::const_iterator
|
||||||
sit=cFiles.begin();
|
sit=cFiles.begin();
|
||||||
sit!=cFiles.end();
|
sit!=cFiles.end();
|
||||||
++sit)
|
++sit)
|
||||||
|
@ -483,7 +483,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
// check if there's a matching header around
|
// check if there's a matching header around
|
||||||
for(std::vector<std::string>::const_iterator
|
for(std::vector<std::string>::const_iterator
|
||||||
ext = mf->GetHeaderExtensions().begin();
|
ext = mf->GetHeaderExtensions().begin();
|
||||||
ext != mf->GetHeaderExtensions().end();
|
ext != mf->GetHeaderExtensions().end();
|
||||||
++ext)
|
++ext)
|
||||||
{
|
{
|
||||||
std::string hname=headerBasename;
|
std::string hname=headerBasename;
|
||||||
|
@ -506,7 +506,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
|
|
||||||
// insert all source files in the CodeBlocks project
|
// insert all source files in the CodeBlocks project
|
||||||
// first the C/C++ implementation files, then all others
|
// first the C/C++ implementation files, then all others
|
||||||
for (std::map<std::string, cmSourceFile*>::const_iterator
|
for (std::map<std::string, cmSourceFile*>::const_iterator
|
||||||
sit=cFiles.begin();
|
sit=cFiles.begin();
|
||||||
sit!=cFiles.end();
|
sit!=cFiles.end();
|
||||||
++sit)
|
++sit)
|
||||||
|
@ -514,7 +514,7 @@ void cmExtraCodeBlocksGenerator
|
||||||
fout<<" <Unit filename=\""<< sit->first <<"\">\n"
|
fout<<" <Unit filename=\""<< sit->first <<"\">\n"
|
||||||
" </Unit>\n";
|
" </Unit>\n";
|
||||||
}
|
}
|
||||||
for (std::set<std::string>::const_iterator
|
for (std::set<std::string>::const_iterator
|
||||||
sit=otherFiles.begin();
|
sit=otherFiles.begin();
|
||||||
sit!=otherFiles.end();
|
sit!=otherFiles.end();
|
||||||
++sit)
|
++sit)
|
||||||
|
@ -577,7 +577,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
|
||||||
" <Option compiler=\"" << compiler << "\" />\n"
|
" <Option compiler=\"" << compiler << "\" />\n"
|
||||||
" <Compiler>\n";
|
" <Compiler>\n";
|
||||||
// the include directories for this target
|
// the include directories for this target
|
||||||
const std::vector<std::string>& incDirs =
|
const std::vector<std::string>& incDirs =
|
||||||
target->GetMakefile()->GetIncludeDirectories();
|
target->GetMakefile()->GetIncludeDirectories();
|
||||||
for(std::vector<std::string>::const_iterator dirIt=incDirs.begin();
|
for(std::vector<std::string>::const_iterator dirIt=incDirs.begin();
|
||||||
dirIt != incDirs.end();
|
dirIt != incDirs.end();
|
||||||
|
@ -589,27 +589,27 @@ 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->GetStartOutputDirectory() << "\" />\n"
|
||||||
<<" <Option type=\"" << 4 << "\" />\n";
|
<<" <Option type=\"" << 4 << "\" />\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
fout<<" <MakeCommands>\n"
|
fout<<" <MakeCommands>\n"
|
||||||
" <Build command=\""
|
" <Build command=\""
|
||||||
<< this->BuildMakeCommand(make, makefileName.c_str(), targetName)
|
<< this->BuildMakeCommand(make, makefileName.c_str(), targetName)
|
||||||
<< "\" />\n"
|
<< "\" />\n"
|
||||||
" <CompileFile command=\""
|
" <CompileFile command=\""
|
||||||
<< this->BuildMakeCommand(make, makefileName.c_str(),""$file"")
|
<< this->BuildMakeCommand(make, makefileName.c_str(),""$file"")
|
||||||
<< "\" />\n"
|
<< "\" />\n"
|
||||||
" <Clean command=\""
|
" <Clean command=\""
|
||||||
<< this->BuildMakeCommand(make, makefileName.c_str(), "clean")
|
<< this->BuildMakeCommand(make, makefileName.c_str(), "clean")
|
||||||
<< "\" />\n"
|
<< "\" />\n"
|
||||||
" <DistClean command=\""
|
" <DistClean command=\""
|
||||||
<< this->BuildMakeCommand(make, makefileName.c_str(), "clean")
|
<< this->BuildMakeCommand(make, makefileName.c_str(), "clean")
|
||||||
<< "\" />\n"
|
<< "\" />\n"
|
||||||
" </MakeCommands>\n"
|
" </MakeCommands>\n"
|
||||||
" </Target>\n";
|
" </Target>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -675,7 +675,7 @@ int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target)
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
else if ((target->GetType()==cmTarget::SHARED_LIBRARY)
|
else if ((target->GetType()==cmTarget::SHARED_LIBRARY)
|
||||||
|| (target->GetType()==cmTarget::MODULE_LIBRARY))
|
|| (target->GetType()==cmTarget::MODULE_LIBRARY))
|
||||||
{
|
{
|
||||||
return 3;
|
return 3;
|
||||||
|
@ -699,9 +699,9 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand(
|
||||||
}
|
}
|
||||||
else if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
|
else if (strcmp(this->GlobalGenerator->GetName(), "MinGW Makefiles")==0)
|
||||||
{
|
{
|
||||||
// no escaping of spaces in this case, see
|
// no escaping of spaces in this case, see
|
||||||
// http://public.kitware.com/Bug/view.php?id=10014
|
// http://public.kitware.com/Bug/view.php?id=10014
|
||||||
std::string makefileName = makefile;
|
std::string makefileName = makefile;
|
||||||
command += " -f "";
|
command += " -f "";
|
||||||
command += makefileName;
|
command += makefileName;
|
||||||
command += "" ";
|
command += "" ";
|
||||||
|
|
|
@ -34,10 +34,10 @@ public:
|
||||||
virtual const char* GetName() const
|
virtual const char* GetName() const
|
||||||
{ return cmExtraCodeBlocksGenerator::GetActualName();}
|
{ return cmExtraCodeBlocksGenerator::GetActualName();}
|
||||||
static const char* GetActualName() { return "CodeBlocks";}
|
static const char* GetActualName() { return "CodeBlocks";}
|
||||||
static cmExternalMakefileProjectGenerator* New()
|
static cmExternalMakefileProjectGenerator* New()
|
||||||
{ return new cmExtraCodeBlocksGenerator; }
|
{ return new cmExtraCodeBlocksGenerator; }
|
||||||
/** Get the documentation entry for this generator. */
|
/** Get the documentation entry for this generator. */
|
||||||
virtual void GetDocumentation(cmDocumentationEntry& entry,
|
virtual void GetDocumentation(cmDocumentationEntry& entry,
|
||||||
const char* fullName) const;
|
const char* fullName) const;
|
||||||
|
|
||||||
virtual void Generate();
|
virtual void Generate();
|
||||||
|
@ -49,7 +49,7 @@ private:
|
||||||
const std::string& filename);
|
const std::string& filename);
|
||||||
std::string GetCBCompilerId(const cmMakefile* mf);
|
std::string GetCBCompilerId(const cmMakefile* mf);
|
||||||
int GetCBTargetType(cmTarget* target);
|
int GetCBTargetType(cmTarget* target);
|
||||||
std::string BuildMakeCommand(const std::string& make, const char* makefile,
|
std::string BuildMakeCommand(const std::string& make, const char* makefile,
|
||||||
const char* target);
|
const char* target);
|
||||||
void AppendTarget(cmGeneratedFileStream& fout,
|
void AppendTarget(cmGeneratedFileStream& fout,
|
||||||
const char* targetName,
|
const char* targetName,
|
||||||
|
|
|
@ -73,7 +73,7 @@ void cmExtraEclipseCDT4Generator::Generate()
|
||||||
|
|
||||||
this->IsOutOfSourceBuild = (this->HomeDirectory!=this->HomeOutputDirectory);
|
this->IsOutOfSourceBuild = (this->HomeDirectory!=this->HomeOutputDirectory);
|
||||||
|
|
||||||
this->GenerateSourceProject = (this->IsOutOfSourceBuild &&
|
this->GenerateSourceProject = (this->IsOutOfSourceBuild &&
|
||||||
mf->IsOn("ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT"));
|
mf->IsOn("ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT"));
|
||||||
|
|
||||||
// NOTE: This is not good, since it pollutes the source tree. However,
|
// NOTE: This is not good, since it pollutes the source tree. However,
|
||||||
|
@ -109,7 +109,7 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() const
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fout <<
|
fout <<
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
"<projectDescription>\n"
|
"<projectDescription>\n"
|
||||||
"\t<name>" << name << "</name>\n"
|
"\t<name>" << name << "</name>\n"
|
||||||
|
@ -129,7 +129,7 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile() const
|
||||||
void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
|
void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
|
||||||
const char* envVar, cmMakefile* mf)
|
const char* envVar, cmMakefile* mf)
|
||||||
{
|
{
|
||||||
// get the variables from the environment and from the cache and then
|
// get the variables from the environment and from the cache and then
|
||||||
// figure out which one to use:
|
// figure out which one to use:
|
||||||
|
|
||||||
const char* envVarValue = getenv(envVar);
|
const char* envVarValue = getenv(envVar);
|
||||||
|
@ -148,7 +148,7 @@ void cmExtraEclipseCDT4Generator::AddEnvVar(cmGeneratedFileStream& fout,
|
||||||
}
|
}
|
||||||
else if (envVarValue!=0 && cacheValue==0)
|
else if (envVarValue!=0 && cacheValue==0)
|
||||||
{
|
{
|
||||||
// The variable is in the env, but not in the cache. Use it and put it
|
// The variable is in the env, but not in the cache. Use it and put it
|
||||||
// in the cache
|
// in the cache
|
||||||
valueToUse = envVarValue;
|
valueToUse = envVarValue;
|
||||||
mf->AddCacheDefinition(cacheEntryName.c_str(), valueToUse.c_str(),
|
mf->AddCacheDefinition(cacheEntryName.c_str(), valueToUse.c_str(),
|
||||||
|
@ -206,7 +206,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
compilerId = mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID");
|
compilerId = mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID");
|
||||||
}
|
}
|
||||||
|
|
||||||
fout <<
|
fout <<
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||||
"<projectDescription>\n"
|
"<projectDescription>\n"
|
||||||
"\t<name>" <<
|
"\t<name>" <<
|
||||||
|
@ -225,7 +225,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
;
|
;
|
||||||
|
|
||||||
// use clean target
|
// use clean target
|
||||||
fout <<
|
fout <<
|
||||||
"\t\t\t\t<dictionary>\n"
|
"\t\t\t\t<dictionary>\n"
|
||||||
"\t\t\t\t\t<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>\n"
|
"\t\t\t\t\t<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>\n"
|
||||||
"\t\t\t\t\t<value>clean</value>\n"
|
"\t\t\t\t\t<value>clean</value>\n"
|
||||||
|
@ -246,7 +246,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
|
|
||||||
// set the make command
|
// set the make command
|
||||||
std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
|
std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
|
||||||
fout <<
|
fout <<
|
||||||
"\t\t\t\t<dictionary>\n"
|
"\t\t\t\t<dictionary>\n"
|
||||||
"\t\t\t\t\t<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>\n"
|
"\t\t\t\t\t<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>\n"
|
||||||
"\t\t\t\t\t<value>true</value>\n"
|
"\t\t\t\t\t<value>true</value>\n"
|
||||||
|
@ -296,7 +296,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
else if (compilerId == "Intel")
|
else if (compilerId == "Intel")
|
||||||
{
|
{
|
||||||
// if the env.var is set, use this one and put it in the cache
|
// if the env.var is set, use this one and put it in the cache
|
||||||
// if the env.var is not set, but the value is in the cache,
|
// if the env.var is not set, but the value is in the cache,
|
||||||
// use it from the cache:
|
// use it from the cache:
|
||||||
AddEnvVar(fout, "INTEL_LICENSE_FILE", mf);
|
AddEnvVar(fout, "INTEL_LICENSE_FILE", mf);
|
||||||
}
|
}
|
||||||
|
@ -392,9 +392,9 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
|
||||||
{
|
{
|
||||||
fout << "\t<linkedResources>\n";
|
fout << "\t<linkedResources>\n";
|
||||||
// create a linked resource to CMAKE_SOURCE_DIR
|
// create a linked resource to CMAKE_SOURCE_DIR
|
||||||
// (this is not done anymore for each project because of
|
// (this is not done anymore for each project because of
|
||||||
// http://public.kitware.com/Bug/view.php?id=9978 and because I found it
|
// http://public.kitware.com/Bug/view.php?id=9978 and because I found it
|
||||||
// actually quite confusing in bigger projects with many directories and
|
// actually quite confusing in bigger projects with many directories and
|
||||||
// projects, Alex
|
// projects, Alex
|
||||||
|
|
||||||
std::string sourceLinkedResourceName = "[Source directory]";
|
std::string sourceLinkedResourceName = "[Source directory]";
|
||||||
|
@ -440,7 +440,7 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
|
||||||
if(emittedDirs.find(dir) == emittedDirs.end())
|
if(emittedDirs.find(dir) == emittedDirs.end())
|
||||||
{
|
{
|
||||||
emittedDirs.insert(dir);
|
emittedDirs.insert(dir);
|
||||||
fout << "<pathentry include=\""
|
fout << "<pathentry include=\""
|
||||||
<< cmExtraEclipseCDT4Generator::GetEclipsePath(dir)
|
<< cmExtraEclipseCDT4Generator::GetEclipsePath(dir)
|
||||||
<< "\" kind=\"inc\" path=\"\" system=\"true\"/>\n";
|
<< "\" kind=\"inc\" path=\"\" system=\"true\"/>\n";
|
||||||
}
|
}
|
||||||
|
@ -452,7 +452,7 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
|
||||||
void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
{
|
{
|
||||||
std::set<std::string> emmited;
|
std::set<std::string> emmited;
|
||||||
|
|
||||||
const cmMakefile* mf
|
const cmMakefile* mf
|
||||||
= this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
= this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile();
|
||||||
|
|
||||||
|
@ -465,7 +465,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// add header
|
// add header
|
||||||
fout <<
|
fout <<
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
|
||||||
"<?fileVersion 4.0.0?>\n\n"
|
"<?fileVersion 4.0.0?>\n\n"
|
||||||
"<cproject>\n"
|
"<cproject>\n"
|
||||||
|
@ -475,7 +475,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
fout << "<cconfiguration id=\"org.eclipse.cdt.core.default.config.1\">\n";
|
fout << "<cconfiguration id=\"org.eclipse.cdt.core.default.config.1\">\n";
|
||||||
|
|
||||||
// Configuration settings...
|
// Configuration settings...
|
||||||
fout <<
|
fout <<
|
||||||
"<storageModule"
|
"<storageModule"
|
||||||
" buildSystemId=\"org.eclipse.cdt.core.defaultConfigDataProvider\""
|
" buildSystemId=\"org.eclipse.cdt.core.defaultConfigDataProvider\""
|
||||||
" id=\"org.eclipse.cdt.core.default.config.1\""
|
" id=\"org.eclipse.cdt.core.default.config.1\""
|
||||||
|
@ -536,9 +536,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
fout << "</extensions>\n"
|
fout << "</extensions>\n"
|
||||||
"</storageModule>\n"
|
"</storageModule>\n"
|
||||||
;
|
;
|
||||||
|
|
||||||
// ???
|
// ???
|
||||||
fout <<
|
fout <<
|
||||||
"<storageModule moduleId=\"org.eclipse.cdt.core.language.mapping\">\n"
|
"<storageModule moduleId=\"org.eclipse.cdt.core.language.mapping\">\n"
|
||||||
"<project-mappings/>\n"
|
"<project-mappings/>\n"
|
||||||
"</storageModule>\n"
|
"</storageModule>\n"
|
||||||
|
@ -619,13 +619,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
// we have -DFOO
|
// we have -DFOO
|
||||||
def = *di;
|
def = *di;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert the definition if not already added.
|
// insert the definition if not already added.
|
||||||
if(emmited.find(def) == emmited.end())
|
if(emmited.find(def) == emmited.end())
|
||||||
{
|
{
|
||||||
emmited.insert(def);
|
emmited.insert(def);
|
||||||
fout << "<pathentry kind=\"mac\" name=\"" << def
|
fout << "<pathentry kind=\"mac\" name=\"" << def
|
||||||
<< "\" path=\"\" value=\"" << this->EscapeForXML(val)
|
<< "\" path=\"\" value=\"" << this->EscapeForXML(val)
|
||||||
<< "\"/>\n";
|
<< "\"/>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -712,8 +712,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
= (*it)->GetMakefile()->GetIncludeDirectories();
|
= (*it)->GetMakefile()->GetIncludeDirectories();
|
||||||
this->AppendIncludeDirectories(fout, includeDirs, emmited);
|
this->AppendIncludeDirectories(fout, includeDirs, emmited);
|
||||||
}
|
}
|
||||||
// now also the system include directories, in case we found them in
|
// now also the system include directories, in case we found them in
|
||||||
// CMakeSystemSpecificInformation.cmake. This makes Eclipse find the
|
// CMakeSystemSpecificInformation.cmake. This makes Eclipse find the
|
||||||
// standard headers.
|
// standard headers.
|
||||||
mf->GetDefinition("CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS");
|
mf->GetDefinition("CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS");
|
||||||
std::string compiler = mf->GetSafeDefinition("CMAKE_C_COMPILER");
|
std::string compiler = mf->GetSafeDefinition("CMAKE_C_COMPILER");
|
||||||
|
@ -738,7 +738,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
fout << "</storageModule>\n";
|
fout << "</storageModule>\n";
|
||||||
|
|
||||||
// add build targets
|
// add build targets
|
||||||
fout <<
|
fout <<
|
||||||
"<storageModule moduleId=\"org.eclipse.cdt.make.core.buildtargets\">\n"
|
"<storageModule moduleId=\"org.eclipse.cdt.make.core.buildtargets\">\n"
|
||||||
"<buildTargets>\n"
|
"<buildTargets>\n"
|
||||||
;
|
;
|
||||||
|
@ -746,7 +746,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
|
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
|
||||||
cmGlobalGenerator* generator
|
cmGlobalGenerator* generator
|
||||||
= const_cast<cmGlobalGenerator*>(this->GlobalGenerator);
|
= const_cast<cmGlobalGenerator*>(this->GlobalGenerator);
|
||||||
|
|
||||||
std::string allTarget;
|
std::string allTarget;
|
||||||
std::string cleanTarget;
|
std::string cleanTarget;
|
||||||
if (generator->GetAllTargetName())
|
if (generator->GetAllTargetName())
|
||||||
|
@ -758,7 +758,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
cleanTarget = generator->GetCleanTargetName();
|
cleanTarget = generator->GetCleanTargetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
// add all executable and library targets and some of the GLOBAL
|
// add all executable and library targets and some of the GLOBAL
|
||||||
// and UTILITY targets
|
// and UTILITY targets
|
||||||
for (std::vector<cmLocalGenerator*>::const_iterator
|
for (std::vector<cmLocalGenerator*>::const_iterator
|
||||||
it = this->GlobalGenerator->GetLocalGenerators().begin();
|
it = this->GlobalGenerator->GetLocalGenerators().begin();
|
||||||
|
@ -781,7 +781,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
case cmTarget::GLOBAL_TARGET:
|
case cmTarget::GLOBAL_TARGET:
|
||||||
{
|
{
|
||||||
bool insertTarget = false;
|
bool insertTarget = false;
|
||||||
// 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 (subdir.empty())
|
if (subdir.empty())
|
||||||
{
|
{
|
||||||
|
@ -813,7 +813,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
// Experimental-"sub"targets as e.g. NightlyStart
|
// Experimental-"sub"targets as e.g. NightlyStart
|
||||||
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
|
if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly"))
|
||||||
|| ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
|
|| ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous"))
|
||||||
|| ((ti->first.find("Experimental")==0)
|
|| ((ti->first.find("Experimental")==0)
|
||||||
&& (ti->first!="Experimental")))
|
&& (ti->first!="Experimental")))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -842,7 +842,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert the all and clean targets in every subdir
|
// insert the all and clean targets in every subdir
|
||||||
if (!allTarget.empty())
|
if (!allTarget.empty())
|
||||||
{
|
{
|
||||||
|
@ -955,7 +955,7 @@ std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value)
|
||||||
// Helper functions
|
// Helper functions
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmExtraEclipseCDT4Generator
|
void cmExtraEclipseCDT4Generator
|
||||||
::AppendStorageScanners(cmGeneratedFileStream& fout,
|
::AppendStorageScanners(cmGeneratedFileStream& fout,
|
||||||
const cmMakefile& makefile)
|
const cmMakefile& makefile)
|
||||||
{
|
{
|
||||||
// we need the "make" and the C (or C++) compiler which are used, Alex
|
// we need the "make" and the C (or C++) compiler which are used, Alex
|
||||||
|
@ -972,7 +972,7 @@ void cmExtraEclipseCDT4Generator
|
||||||
|
|
||||||
|
|
||||||
// the following right now hardcodes gcc behaviour :-/
|
// the following right now hardcodes gcc behaviour :-/
|
||||||
fout <<
|
fout <<
|
||||||
"<storageModule moduleId=\"scannerConfiguration\">\n"
|
"<storageModule moduleId=\"scannerConfiguration\">\n"
|
||||||
"<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\""
|
"<autodiscovery enabled=\"true\" problemReportingEnabled=\"true\""
|
||||||
" selectedProfileId="
|
" selectedProfileId="
|
||||||
|
@ -996,8 +996,8 @@ void cmExtraEclipseCDT4Generator
|
||||||
// of that is to sort the targets in the view of Eclipse, so that at first
|
// of that is to sort the targets in the view of Eclipse, so that at first
|
||||||
// the global/utility/all/clean targets appear ": ", then the executable
|
// the global/utility/all/clean targets appear ": ", then the executable
|
||||||
// targets "[exe] ", then the libraries "[lib]", then the rules for the
|
// targets "[exe] ", then the libraries "[lib]", then the rules for the
|
||||||
// object files "[obj]", then for preprocessing only "[pre] " and
|
// object files "[obj]", then for preprocessing only "[pre] " and
|
||||||
// finally the assembly files "[to asm] ". Note the "to" in "to asm",
|
// finally the assembly files "[to asm] ". Note the "to" in "to asm",
|
||||||
// without it, "asm" would be the first targets in the list, with the "to"
|
// without it, "asm" would be the first targets in the list, with the "to"
|
||||||
// they are the last targets, which makes more sense.
|
// they are the last targets, which makes more sense.
|
||||||
void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
|
void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
|
||||||
|
@ -1006,7 +1006,7 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
|
||||||
const std::string& path,
|
const std::string& path,
|
||||||
const char* prefix)
|
const char* prefix)
|
||||||
{
|
{
|
||||||
fout <<
|
fout <<
|
||||||
"<target name=\"" << prefix << target << "\""
|
"<target name=\"" << prefix << target << "\""
|
||||||
" path=\"" << path.c_str() << "\""
|
" path=\"" << path.c_str() << "\""
|
||||||
" targetID=\"org.eclipse.cdt.make.MakeTargetBuilder\">\n"
|
" targetID=\"org.eclipse.cdt.make.MakeTargetBuilder\">\n"
|
||||||
|
@ -1033,7 +1033,7 @@ void cmExtraEclipseCDT4Generator
|
||||||
bool runActionUseDefault,
|
bool runActionUseDefault,
|
||||||
bool sipParserEnabled)
|
bool sipParserEnabled)
|
||||||
{
|
{
|
||||||
fout <<
|
fout <<
|
||||||
"<profile id=\"" << profileID << "\">\n"
|
"<profile id=\"" << profileID << "\">\n"
|
||||||
"<buildOutputProvider>\n"
|
"<buildOutputProvider>\n"
|
||||||
"<openAction enabled=\"" << (openActionEnabled ? "true" : "false")
|
"<openAction enabled=\"" << (openActionEnabled ? "true" : "false")
|
||||||
|
|
|
@ -70,7 +70,7 @@ private:
|
||||||
static std::string EscapeForXML(const std::string& value);
|
static std::string EscapeForXML(const std::string& value);
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
static void AppendStorageScanners(cmGeneratedFileStream& fout,
|
static void AppendStorageScanners(cmGeneratedFileStream& fout,
|
||||||
const cmMakefile& makefile);
|
const cmMakefile& makefile);
|
||||||
static void AppendTarget (cmGeneratedFileStream& fout,
|
static void AppendTarget (cmGeneratedFileStream& fout,
|
||||||
const std::string& target,
|
const std::string& target,
|
||||||
|
@ -100,7 +100,7 @@ private:
|
||||||
const std::vector<std::string>& includeDirs,
|
const std::vector<std::string>& includeDirs,
|
||||||
std::set<std::string>& emittedDirs);
|
std::set<std::string>& emittedDirs);
|
||||||
|
|
||||||
static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
|
static void AddEnvVar(cmGeneratedFileStream& fout, const char* envVar,
|
||||||
cmMakefile* mf);
|
cmMakefile* mf);
|
||||||
|
|
||||||
std::vector<std::string> SrcLinkedResources;
|
std::vector<std::string> SrcLinkedResources;
|
||||||
|
|
|
@ -38,31 +38,31 @@ public:
|
||||||
///! Free any memory allocated with the GlobalGenerator
|
///! Free any memory allocated with the GlobalGenerator
|
||||||
cmGlobalGenerator();
|
cmGlobalGenerator();
|
||||||
virtual ~cmGlobalGenerator();
|
virtual ~cmGlobalGenerator();
|
||||||
|
|
||||||
///! Create a local generator appropriate to this Global Generator
|
///! Create a local generator appropriate to this Global Generator
|
||||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||||
|
|
||||||
///! Get the name for this generator
|
///! Get the name for this generator
|
||||||
virtual const char *GetName() const { return "Generic"; };
|
virtual const char *GetName() const { return "Generic"; };
|
||||||
|
|
||||||
/** Get the documentation entry for this generator. */
|
/** Get the documentation entry for this generator. */
|
||||||
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
|
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create LocalGenerators and process the CMakeLists files. This does not
|
* Create LocalGenerators and process the CMakeLists files. This does not
|
||||||
* actually produce any makefiles, DSPs, etc.
|
* actually produce any makefiles, DSPs, etc.
|
||||||
*/
|
*/
|
||||||
virtual void Configure();
|
virtual void Configure();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
* basically creates a series of LocalGenerators for each directory and
|
* basically creates a series of LocalGenerators for each directory and
|
||||||
* requests that they Generate.
|
* requests that they Generate.
|
||||||
*/
|
*/
|
||||||
virtual void Generate();
|
virtual void Generate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/Get and Clear the enabled languages.
|
* Set/Get and Clear the enabled languages.
|
||||||
*/
|
*/
|
||||||
void SetLanguageEnabled(const char*, cmMakefile* mf);
|
void SetLanguageEnabled(const char*, cmMakefile* mf);
|
||||||
bool GetLanguageEnabled(const char*) const;
|
bool GetLanguageEnabled(const char*) const;
|
||||||
|
@ -70,7 +70,7 @@ public:
|
||||||
void GetEnabledLanguages(std::vector<std::string>& lang);
|
void GetEnabledLanguages(std::vector<std::string>& lang);
|
||||||
/**
|
/**
|
||||||
* Try to determine system infomation such as shared library
|
* Try to determine system infomation such as shared library
|
||||||
* extension, pthreads, byte order etc.
|
* extension, pthreads, byte order etc.
|
||||||
*/
|
*/
|
||||||
virtual void EnableLanguage(std::vector<std::string>const& languages,
|
virtual void EnableLanguage(std::vector<std::string>const& languages,
|
||||||
cmMakefile *, bool optional);
|
cmMakefile *, bool optional);
|
||||||
|
@ -88,7 +88,7 @@ public:
|
||||||
const char *projectName, const char *targetName,
|
const char *projectName, const char *targetName,
|
||||||
bool fast, std::string *output, cmMakefile* mf);
|
bool fast, std::string *output, cmMakefile* mf);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build a file given the following information. This is a more direct call
|
* Build a file given the following information. This is a more direct call
|
||||||
* that is used by both CTest and TryCompile. If target name is NULL or
|
* that is used by both CTest and TryCompile. If target name is NULL or
|
||||||
|
@ -104,28 +104,28 @@ public:
|
||||||
const char* extraOptions = 0,
|
const char* extraOptions = 0,
|
||||||
std::vector<std::string> const& nativeOptions =
|
std::vector<std::string> const& nativeOptions =
|
||||||
std::vector<std::string>());
|
std::vector<std::string>());
|
||||||
|
|
||||||
virtual std::string GenerateBuildCommand(
|
virtual std::string GenerateBuildCommand(
|
||||||
const char* makeProgram,
|
const char* makeProgram,
|
||||||
const char *projectName, const char* additionalOptions,
|
const char *projectName, const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config, bool ignoreErrors, bool fast);
|
const char* config, bool ignoreErrors, bool fast);
|
||||||
|
|
||||||
|
|
||||||
///! Set the CMake instance
|
///! Set the CMake instance
|
||||||
void SetCMakeInstance(cmake *cm);
|
void SetCMakeInstance(cmake *cm);
|
||||||
|
|
||||||
///! Get the CMake instance
|
///! Get the CMake instance
|
||||||
cmake *GetCMakeInstance() { return this->CMakeInstance; };
|
cmake *GetCMakeInstance() { return this->CMakeInstance; };
|
||||||
|
|
||||||
void SetConfiguredFilesPath(cmGlobalGenerator* gen);
|
void SetConfiguredFilesPath(cmGlobalGenerator* gen);
|
||||||
const std::vector<cmLocalGenerator *>& GetLocalGenerators() const {
|
const std::vector<cmLocalGenerator *>& GetLocalGenerators() const {
|
||||||
return this->LocalGenerators;}
|
return this->LocalGenerators;}
|
||||||
|
|
||||||
cmLocalGenerator* GetCurrentLocalGenerator()
|
cmLocalGenerator* GetCurrentLocalGenerator()
|
||||||
{return this->CurrentLocalGenerator;}
|
{return this->CurrentLocalGenerator;}
|
||||||
|
|
||||||
void SetCurrentLocalGenerator(cmLocalGenerator* lg)
|
void SetCurrentLocalGenerator(cmLocalGenerator* lg)
|
||||||
{this->CurrentLocalGenerator = lg;}
|
{this->CurrentLocalGenerator = lg;}
|
||||||
|
|
||||||
void AddLocalGenerator(cmLocalGenerator *lg);
|
void AddLocalGenerator(cmLocalGenerator *lg);
|
||||||
|
@ -138,11 +138,11 @@ public:
|
||||||
|
|
||||||
void AddInstallComponent(const char* component);
|
void AddInstallComponent(const char* component);
|
||||||
|
|
||||||
const std::set<cmStdString>* GetInstallComponents() const
|
const std::set<cmStdString>* GetInstallComponents() const
|
||||||
{ return &InstallComponents; }
|
{ return &InstallComponents; }
|
||||||
|
|
||||||
///! Add one installed target to the sets of the exports
|
///! Add one installed target to the sets of the exports
|
||||||
void AddTargetToExports(const char* exportSet, cmTarget* target,
|
void AddTargetToExports(const char* exportSet, cmTarget* target,
|
||||||
cmInstallTargetGenerator* archive,
|
cmInstallTargetGenerator* archive,
|
||||||
cmInstallTargetGenerator* runTime,
|
cmInstallTargetGenerator* runTime,
|
||||||
cmInstallTargetGenerator* library,
|
cmInstallTargetGenerator* library,
|
||||||
|
@ -158,7 +158,7 @@ public:
|
||||||
void EnableInstallTarget();
|
void EnableInstallTarget();
|
||||||
|
|
||||||
int TryCompileTimeout;
|
int TryCompileTimeout;
|
||||||
|
|
||||||
bool GetForceUnixPaths() {return this->ForceUnixPaths;}
|
bool GetForceUnixPaths() {return this->ForceUnixPaths;}
|
||||||
bool GetToolSupportsColor() { return this->ToolSupportsColor; }
|
bool GetToolSupportsColor() { return this->ToolSupportsColor; }
|
||||||
void SetToolSupportsColor(bool enable) { this->ToolSupportsColor = enable; }
|
void SetToolSupportsColor(bool enable) { this->ToolSupportsColor = enable; }
|
||||||
|
@ -254,7 +254,7 @@ public:
|
||||||
bool BinaryDirectoryIsNew(const char* dir)
|
bool BinaryDirectoryIsNew(const char* dir)
|
||||||
{
|
{
|
||||||
return this->BinaryDirectories.insert(dir).second;
|
return this->BinaryDirectories.insert(dir).second;
|
||||||
}
|
}
|
||||||
/** Supported systems creates a GUID for the given name */
|
/** Supported systems creates a GUID for the given name */
|
||||||
virtual void CreateGUID(const char*) {}
|
virtual void CreateGUID(const char*) {}
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ protected:
|
||||||
|
|
||||||
bool CheckTargets();
|
bool CheckTargets();
|
||||||
|
|
||||||
// Fill the ProjectMap, this must be called after LocalGenerators
|
// Fill the ProjectMap, this must be called after LocalGenerators
|
||||||
// has been populated.
|
// has been populated.
|
||||||
void FillProjectMap();
|
void FillProjectMap();
|
||||||
void CheckLocalGenerators();
|
void CheckLocalGenerators();
|
||||||
|
@ -328,13 +328,13 @@ protected:
|
||||||
private:
|
private:
|
||||||
float FirstTimeProgress;
|
float FirstTimeProgress;
|
||||||
// If you add a new map here, make sure it is copied
|
// If you add a new map here, make sure it is copied
|
||||||
// in EnableLanguagesFromGenerator
|
// in EnableLanguagesFromGenerator
|
||||||
std::map<cmStdString, bool> IgnoreExtensions;
|
std::map<cmStdString, bool> IgnoreExtensions;
|
||||||
std::map<cmStdString, bool> LanguageEnabled;
|
std::map<cmStdString, bool> LanguageEnabled;
|
||||||
std::map<cmStdString, cmStdString> OutputExtensions;
|
std::map<cmStdString, cmStdString> OutputExtensions;
|
||||||
std::map<cmStdString, cmStdString> LanguageToOutputExtension;
|
std::map<cmStdString, cmStdString> LanguageToOutputExtension;
|
||||||
std::map<cmStdString, cmStdString> ExtensionToLanguage;
|
std::map<cmStdString, cmStdString> ExtensionToLanguage;
|
||||||
std::map<cmStdString, int> LanguageToLinkerPreference;
|
std::map<cmStdString, int> LanguageToLinkerPreference;
|
||||||
|
|
||||||
// Record hashes for rules and outputs.
|
// Record hashes for rules and outputs.
|
||||||
struct RuleHash { char Data[32]; };
|
struct RuleHash { char Data[32]; };
|
||||||
|
|
|
@ -35,8 +35,8 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3()
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalUnixMakefileGenerator3
|
void cmGlobalUnixMakefileGenerator3
|
||||||
::EnableLanguage(std::vector<std::string>const& languages,
|
::EnableLanguage(std::vector<std::string>const& languages,
|
||||||
cmMakefile *mf,
|
cmMakefile *mf,
|
||||||
bool optional)
|
bool optional)
|
||||||
{
|
{
|
||||||
this->cmGlobalGenerator::EnableLanguage(languages, mf, optional);
|
this->cmGlobalGenerator::EnableLanguage(languages, mf, optional);
|
||||||
|
@ -52,17 +52,17 @@ void cmGlobalUnixMakefileGenerator3
|
||||||
std::string langComp = "CMAKE_";
|
std::string langComp = "CMAKE_";
|
||||||
langComp += lang;
|
langComp += lang;
|
||||||
langComp += "_COMPILER";
|
langComp += "_COMPILER";
|
||||||
|
|
||||||
if(!mf->GetDefinition(langComp.c_str()))
|
if(!mf->GetDefinition(langComp.c_str()))
|
||||||
{
|
{
|
||||||
if(!optional)
|
if(!optional)
|
||||||
{
|
{
|
||||||
cmSystemTools::Error(langComp.c_str(),
|
cmSystemTools::Error(langComp.c_str(),
|
||||||
" not set, after EnableLanguage");
|
" not set, after EnableLanguage");
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const char* name = mf->GetRequiredDefinition(langComp.c_str());
|
const char* name = mf->GetRequiredDefinition(langComp.c_str());
|
||||||
if(!cmSystemTools::FileIsFullPath(name))
|
if(!cmSystemTools::FileIsFullPath(name))
|
||||||
{
|
{
|
||||||
path = cmSystemTools::FindProgram(name);
|
path = cmSystemTools::FindProgram(name);
|
||||||
|
@ -71,7 +71,7 @@ void cmGlobalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
path = name;
|
path = name;
|
||||||
}
|
}
|
||||||
if((path.size() == 0 || !cmSystemTools::FileExists(path.c_str()))
|
if((path.size() == 0 || !cmSystemTools::FileExists(path.c_str()))
|
||||||
&& (optional==false))
|
&& (optional==false))
|
||||||
{
|
{
|
||||||
std::string message = "your ";
|
std::string message = "your ";
|
||||||
|
@ -97,8 +97,8 @@ void cmGlobalUnixMakefileGenerator3
|
||||||
cmSystemTools::ConvertToUnixSlashes(cnameString);
|
cmSystemTools::ConvertToUnixSlashes(cnameString);
|
||||||
cmSystemTools::ConvertToUnixSlashes(pathString);
|
cmSystemTools::ConvertToUnixSlashes(pathString);
|
||||||
if (cnameString != pathString)
|
if (cnameString != pathString)
|
||||||
{
|
{
|
||||||
const char* cvars =
|
const char* cvars =
|
||||||
this->GetCMakeInstance()->GetProperty(
|
this->GetCMakeInstance()->GetProperty(
|
||||||
"__CMAKE_DELETE_CACHE_CHANGE_VARS_");
|
"__CMAKE_DELETE_CACHE_CHANGE_VARS_");
|
||||||
if(cvars)
|
if(cvars)
|
||||||
|
@ -140,7 +140,7 @@ void cmGlobalUnixMakefileGenerator3
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalUnixMakefileGenerator3::Generate()
|
void cmGlobalUnixMakefileGenerator3::Generate()
|
||||||
{
|
{
|
||||||
// first do superclass method
|
// first do superclass method
|
||||||
this->cmGlobalGenerator::Generate();
|
this->cmGlobalGenerator::Generate();
|
||||||
|
@ -197,7 +197,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
|
||||||
// Open the output file. This should not be copy-if-different
|
// Open the output file. This should not be copy-if-different
|
||||||
// because the check-build-system step compares the makefile time to
|
// because the check-build-system step compares the makefile time to
|
||||||
// see if the build system must be regenerated.
|
// see if the build system must be regenerated.
|
||||||
std::string makefileName =
|
std::string makefileName =
|
||||||
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||||
makefileName += cmake::GetCMakeFilesDirectory();
|
makefileName += cmake::GetCMakeFilesDirectory();
|
||||||
makefileName += "/Makefile2";
|
makefileName += "/Makefile2";
|
||||||
|
@ -206,11 +206,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get a local generator for some useful methods
|
// get a local generator for some useful methods
|
||||||
cmLocalUnixMakefileGenerator3 *lg =
|
cmLocalUnixMakefileGenerator3 *lg =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[0]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[0]);
|
||||||
|
|
||||||
// Write the do not edit header.
|
// Write the do not edit header.
|
||||||
lg->WriteDisclaimer(makefileStream);
|
lg->WriteDisclaimer(makefileStream);
|
||||||
|
|
||||||
|
@ -239,8 +239,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write and empty all:
|
// Write and empty all:
|
||||||
lg->WriteMakeRule(makefileStream,
|
lg->WriteMakeRule(makefileStream,
|
||||||
"The main recursive all target", "all",
|
"The main recursive all target", "all",
|
||||||
depends, no_commands, true);
|
depends, no_commands, true);
|
||||||
|
|
||||||
// Write an empty preinstall:
|
// Write an empty preinstall:
|
||||||
|
@ -250,12 +250,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
|
||||||
|
|
||||||
// Write out the "special" stuff
|
// Write out the "special" stuff
|
||||||
lg->WriteSpecialTargetsTop(makefileStream);
|
lg->WriteSpecialTargetsTop(makefileStream);
|
||||||
|
|
||||||
// write the target convenience rules
|
// write the target convenience rules
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
lg =
|
lg =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
||||||
this->WriteConvenienceRules2(makefileStream,lg);
|
this->WriteConvenienceRules2(makefileStream,lg);
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
// Open the output file. This should not be copy-if-different
|
// Open the output file. This should not be copy-if-different
|
||||||
// because the check-build-system step compares the makefile time to
|
// because the check-build-system step compares the makefile time to
|
||||||
// see if the build system must be regenerated.
|
// see if the build system must be regenerated.
|
||||||
std::string cmakefileName =
|
std::string cmakefileName =
|
||||||
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||||
cmakefileName += cmake::GetCMakeFilesDirectory();
|
cmakefileName += cmake::GetCMakeFilesDirectory();
|
||||||
cmakefileName += "/Makefile.cmake";
|
cmakefileName += "/Makefile.cmake";
|
||||||
|
@ -281,14 +281,14 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string makefileName =
|
std::string makefileName =
|
||||||
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||||
makefileName += "/Makefile";
|
makefileName += "/Makefile";
|
||||||
|
|
||||||
// get a local generator for some useful methods
|
// get a local generator for some useful methods
|
||||||
cmLocalUnixMakefileGenerator3 *lg =
|
cmLocalUnixMakefileGenerator3 *lg =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[0]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[0]);
|
||||||
|
|
||||||
// Write the do not edit header.
|
// Write the do not edit header.
|
||||||
lg->WriteDisclaimer(cmakefileStream);
|
lg->WriteDisclaimer(cmakefileStream);
|
||||||
|
|
||||||
|
@ -301,9 +301,9 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
std::vector<std::string> lfiles;
|
std::vector<std::string> lfiles;
|
||||||
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
lg =
|
lg =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
||||||
|
|
||||||
// Get the list of files contributing to this generation step.
|
// Get the list of files contributing to this generation step.
|
||||||
lfiles.insert(lfiles.end(),lg->GetMakefile()->GetListFiles().begin(),
|
lfiles.insert(lfiles.end(),lg->GetMakefile()->GetListFiles().begin(),
|
||||||
lg->GetMakefile()->GetListFiles().end());
|
lg->GetMakefile()->GetListFiles().end());
|
||||||
|
@ -311,7 +311,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
// Sort the list and remove duplicates.
|
// Sort the list and remove duplicates.
|
||||||
std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
|
std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
|
||||||
#if !defined(__VMS) // The Compaq STL on VMS crashes, so accept duplicates.
|
#if !defined(__VMS) // The Compaq STL on VMS crashes, so accept duplicates.
|
||||||
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());
|
||||||
#endif
|
#endif
|
||||||
|
@ -327,14 +327,14 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
cmakefileStream
|
cmakefileStream
|
||||||
<< "# The top level Makefile was generated from the following files:\n"
|
<< "# The top level Makefile was generated from the following files:\n"
|
||||||
<< "SET(CMAKE_MAKEFILE_DEPENDS\n"
|
<< "SET(CMAKE_MAKEFILE_DEPENDS\n"
|
||||||
<< " \""
|
<< " \""
|
||||||
<< lg->Convert(cache.c_str(),
|
<< lg->Convert(cache.c_str(),
|
||||||
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n";
|
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n";
|
||||||
for(std::vector<std::string>::const_iterator i = lfiles.begin();
|
for(std::vector<std::string>::const_iterator i = lfiles.begin();
|
||||||
i != lfiles.end(); ++i)
|
i != lfiles.end(); ++i)
|
||||||
{
|
{
|
||||||
cmakefileStream
|
cmakefileStream
|
||||||
<< " \""
|
<< " \""
|
||||||
<< lg->Convert(i->c_str(), cmLocalGenerator::START_OUTPUT).c_str()
|
<< lg->Convert(i->c_str(), cmLocalGenerator::START_OUTPUT).c_str()
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
|
@ -350,10 +350,10 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
cmakefileStream
|
cmakefileStream
|
||||||
<< "# The corresponding makefile is:\n"
|
<< "# The corresponding makefile is:\n"
|
||||||
<< "SET(CMAKE_MAKEFILE_OUTPUTS\n"
|
<< "SET(CMAKE_MAKEFILE_OUTPUTS\n"
|
||||||
<< " \""
|
<< " \""
|
||||||
<< lg->Convert(makefileName.c_str(),
|
<< lg->Convert(makefileName.c_str(),
|
||||||
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n"
|
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n"
|
||||||
<< " \""
|
<< " \""
|
||||||
<< lg->Convert(check.c_str(),
|
<< lg->Convert(check.c_str(),
|
||||||
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n";
|
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n";
|
||||||
cmakefileStream << " )\n\n";
|
cmakefileStream << " )\n\n";
|
||||||
|
@ -377,19 +377,19 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
|
||||||
std::string tmpStr;
|
std::string tmpStr;
|
||||||
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
lg =
|
lg =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
||||||
tmpStr = lg->GetMakefile()->GetStartOutputDirectory();
|
tmpStr = lg->GetMakefile()->GetStartOutputDirectory();
|
||||||
tmpStr += cmake::GetCMakeFilesDirectory();
|
tmpStr += cmake::GetCMakeFilesDirectory();
|
||||||
tmpStr += "/CMakeDirectoryInformation.cmake";
|
tmpStr += "/CMakeDirectoryInformation.cmake";
|
||||||
cmakefileStream << " \"" <<
|
cmakefileStream << " \"" <<
|
||||||
lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str()
|
lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str()
|
||||||
<< "\"\n";
|
<< "\"\n";
|
||||||
}
|
}
|
||||||
cmakefileStream << " )\n\n";
|
cmakefileStream << " )\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
this->WriteMainCMakefileLanguageRules(cmakefileStream,
|
this->WriteMainCMakefileLanguageRules(cmakefileStream,
|
||||||
this->LocalGenerators);
|
this->LocalGenerators);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +468,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
|
|
||||||
// The directory-level rule should depend on the directory-level
|
// The directory-level rule should depend on the directory-level
|
||||||
// rules of the subdirectories.
|
// rules of the subdirectories.
|
||||||
for(std::vector<cmLocalGenerator*>::iterator sdi =
|
for(std::vector<cmLocalGenerator*>::iterator sdi =
|
||||||
lg->GetChildren().begin(); sdi != lg->GetChildren().end(); ++sdi)
|
lg->GetChildren().begin(); sdi != lg->GetChildren().end(); ++sdi)
|
||||||
{
|
{
|
||||||
cmLocalUnixMakefileGenerator3* slg =
|
cmLocalUnixMakefileGenerator3* slg =
|
||||||
|
@ -528,7 +528,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
|
|
||||||
|
|
||||||
std::string cmGlobalUnixMakefileGenerator3
|
std::string cmGlobalUnixMakefileGenerator3
|
||||||
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
|
::GenerateBuildCommand(const char* makeProgram, const char *projectName,
|
||||||
const char* additionalOptions, const char *targetName,
|
const char* additionalOptions, const char *targetName,
|
||||||
const char* config, bool ignoreErrors, bool fast)
|
const char* config, bool ignoreErrors, bool fast)
|
||||||
{
|
{
|
||||||
|
@ -536,9 +536,9 @@ std::string cmGlobalUnixMakefileGenerator3
|
||||||
(void)projectName;
|
(void)projectName;
|
||||||
(void)config;
|
(void)config;
|
||||||
|
|
||||||
std::string makeCommand =
|
std::string makeCommand =
|
||||||
cmSystemTools::ConvertToUnixOutputPath(makeProgram);
|
cmSystemTools::ConvertToUnixOutputPath(makeProgram);
|
||||||
|
|
||||||
// Since we have full control over the invocation of nmake, let us
|
// Since we have full control over the invocation of nmake, let us
|
||||||
// make it quiet.
|
// make it quiet.
|
||||||
if ( strcmp(this->GetName(), "NMake Makefiles") == 0 )
|
if ( strcmp(this->GetName(), "NMake Makefiles") == 0 )
|
||||||
|
@ -573,7 +573,7 @@ std::string cmGlobalUnixMakefileGenerator3
|
||||||
(this->CMakeInstance->GetStartOutputDirectory());
|
(this->CMakeInstance->GetStartOutputDirectory());
|
||||||
lg->GetMakefile()->MakeStartDirectoriesCurrent();
|
lg->GetMakefile()->MakeStartDirectoriesCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
makeCommand += " \"";
|
makeCommand += " \"";
|
||||||
std::string tname = targetName;
|
std::string tname = targetName;
|
||||||
if(fast)
|
if(fast)
|
||||||
|
@ -595,14 +595,14 @@ std::string cmGlobalUnixMakefileGenerator3
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmGlobalUnixMakefileGenerator3
|
cmGlobalUnixMakefileGenerator3
|
||||||
::WriteConvenienceRules(std::ostream& ruleFileStream,
|
::WriteConvenienceRules(std::ostream& ruleFileStream,
|
||||||
std::set<cmStdString> &emitted)
|
std::set<cmStdString> &emitted)
|
||||||
{
|
{
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
std::vector<std::string> commands;
|
std::vector<std::string> commands;
|
||||||
|
|
||||||
depends.push_back("cmake_check_build_system");
|
depends.push_back("cmake_check_build_system");
|
||||||
|
|
||||||
// write the target convenience rules
|
// write the target convenience rules
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
cmLocalUnixMakefileGenerator3 *lg;
|
cmLocalUnixMakefileGenerator3 *lg;
|
||||||
|
@ -632,7 +632,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
ruleFileStream
|
ruleFileStream
|
||||||
<< "# Target rules for targets named "
|
<< "# Target rules for targets named "
|
||||||
<< t->second.GetName() << "\n\n";
|
<< t->second.GetName() << "\n\n";
|
||||||
|
|
||||||
// Write the rule.
|
// Write the rule.
|
||||||
commands.clear();
|
commands.clear();
|
||||||
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
|
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
|
||||||
|
@ -641,16 +641,16 @@ cmGlobalUnixMakefileGenerator3
|
||||||
(tmp.c_str(),t->second.GetName()));
|
(tmp.c_str(),t->second.GetName()));
|
||||||
depends.clear();
|
depends.clear();
|
||||||
depends.push_back("cmake_check_build_system");
|
depends.push_back("cmake_check_build_system");
|
||||||
lg->WriteMakeRule(ruleFileStream,
|
lg->WriteMakeRule(ruleFileStream,
|
||||||
"Build rule for target.",
|
"Build rule for target.",
|
||||||
t->second.GetName(), depends, commands,
|
t->second.GetName(), depends, commands,
|
||||||
true);
|
true);
|
||||||
|
|
||||||
// Add a fast rule to build the target
|
// Add a fast rule to build the target
|
||||||
std::string localName = lg->GetRelativeTargetDirectory(t->second);
|
std::string localName = lg->GetRelativeTargetDirectory(t->second);
|
||||||
std::string makefileName;
|
std::string makefileName;
|
||||||
makefileName = localName;
|
makefileName = localName;
|
||||||
makefileName += "/build.make";
|
makefileName += "/build.make";
|
||||||
depends.clear();
|
depends.clear();
|
||||||
commands.clear();
|
commands.clear();
|
||||||
std::string makeTargetName = localName;
|
std::string makeTargetName = localName;
|
||||||
|
@ -687,10 +687,10 @@ cmGlobalUnixMakefileGenerator3
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void
|
void
|
||||||
cmGlobalUnixMakefileGenerator3
|
cmGlobalUnixMakefileGenerator3
|
||||||
::WriteConvenienceRules2(std::ostream& ruleFileStream,
|
::WriteConvenienceRules2(std::ostream& ruleFileStream,
|
||||||
cmLocalUnixMakefileGenerator3 *lg)
|
cmLocalUnixMakefileGenerator3 *lg)
|
||||||
{
|
{
|
||||||
std::vector<std::string> depends;
|
std::vector<std::string> depends;
|
||||||
std::vector<std::string> commands;
|
std::vector<std::string> commands;
|
||||||
std::string localName;
|
std::string localName;
|
||||||
std::string makeTargetName;
|
std::string makeTargetName;
|
||||||
|
@ -698,7 +698,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
|
|
||||||
// write the directory level rules for this local gen
|
// write the directory level rules for this local gen
|
||||||
this->WriteDirectoryRules2(ruleFileStream,lg);
|
this->WriteDirectoryRules2(ruleFileStream,lg);
|
||||||
|
|
||||||
depends.push_back("cmake_check_build_system");
|
depends.push_back("cmake_check_build_system");
|
||||||
|
|
||||||
// for each target Generate the rule files for each target.
|
// for each target Generate the rule files for each target.
|
||||||
|
@ -718,15 +718,15 @@ cmGlobalUnixMakefileGenerator3
|
||||||
localName = lg->GetRelativeTargetDirectory(t->second);
|
localName = lg->GetRelativeTargetDirectory(t->second);
|
||||||
makefileName = localName;
|
makefileName = localName;
|
||||||
makefileName += "/build.make";
|
makefileName += "/build.make";
|
||||||
|
|
||||||
bool needRequiresStep = this->NeedRequiresStep(t->second);
|
bool needRequiresStep = this->NeedRequiresStep(t->second);
|
||||||
|
|
||||||
lg->WriteDivider(ruleFileStream);
|
lg->WriteDivider(ruleFileStream);
|
||||||
ruleFileStream
|
ruleFileStream
|
||||||
<< "# Target rules for target "
|
<< "# Target rules for target "
|
||||||
<< localName << "\n\n";
|
<< localName << "\n\n";
|
||||||
|
|
||||||
commands.clear();
|
commands.clear();
|
||||||
makeTargetName = localName;
|
makeTargetName = localName;
|
||||||
makeTargetName += "/depend";
|
makeTargetName += "/depend";
|
||||||
commands.push_back(lg->GetRecursiveMakeCall
|
commands.push_back(lg->GetRecursiveMakeCall
|
||||||
|
@ -744,7 +744,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
makeTargetName += "/build";
|
makeTargetName += "/build";
|
||||||
commands.push_back(lg->GetRecursiveMakeCall
|
commands.push_back(lg->GetRecursiveMakeCall
|
||||||
(makefileName.c_str(),makeTargetName.c_str()));
|
(makefileName.c_str(),makeTargetName.c_str()));
|
||||||
|
|
||||||
// Write the rule.
|
// Write the rule.
|
||||||
localName += "/all";
|
localName += "/all";
|
||||||
depends.clear();
|
depends.clear();
|
||||||
|
@ -780,7 +780,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
this->AppendGlobalTargetDepends(depends,t->second);
|
this->AppendGlobalTargetDepends(depends,t->second);
|
||||||
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
|
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
|
||||||
localName.c_str(), depends, commands, true);
|
localName.c_str(), depends, commands, true);
|
||||||
|
|
||||||
// add the all/all dependency
|
// add the all/all dependency
|
||||||
if(!this->IsExcluded(this->LocalGenerators[0], t->second))
|
if(!this->IsExcluded(this->LocalGenerators[0], t->second))
|
||||||
{
|
{
|
||||||
|
@ -831,17 +831,17 @@ cmGlobalUnixMakefileGenerator3
|
||||||
depends.push_back("cmake_check_build_system");
|
depends.push_back("cmake_check_build_system");
|
||||||
localName = lg->GetRelativeTargetDirectory(t->second);
|
localName = lg->GetRelativeTargetDirectory(t->second);
|
||||||
localName += "/rule";
|
localName += "/rule";
|
||||||
lg->WriteMakeRule(ruleFileStream,
|
lg->WriteMakeRule(ruleFileStream,
|
||||||
"Build rule for subdir invocation for target.",
|
"Build rule for subdir invocation for target.",
|
||||||
localName.c_str(), depends, commands, true);
|
localName.c_str(), depends, commands, true);
|
||||||
|
|
||||||
// Add a target with the canonical name (no prefix, suffix or path).
|
// Add a target with the canonical name (no prefix, suffix or path).
|
||||||
commands.clear();
|
commands.clear();
|
||||||
depends.clear();
|
depends.clear();
|
||||||
depends.push_back(localName);
|
depends.push_back(localName);
|
||||||
lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
||||||
t->second.GetName(), depends, commands, true);
|
t->second.GetName(), depends, commands, true);
|
||||||
|
|
||||||
// Add rules to prepare the target for installation.
|
// Add rules to prepare the target for installation.
|
||||||
if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
|
if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
|
||||||
{
|
{
|
||||||
|
@ -851,7 +851,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
commands.clear();
|
commands.clear();
|
||||||
commands.push_back(lg->GetRecursiveMakeCall
|
commands.push_back(lg->GetRecursiveMakeCall
|
||||||
(makefileName.c_str(), localName.c_str()));
|
(makefileName.c_str(), localName.c_str()));
|
||||||
lg->WriteMakeRule(ruleFileStream,
|
lg->WriteMakeRule(ruleFileStream,
|
||||||
"Pre-install relink rule for target.",
|
"Pre-install relink rule for target.",
|
||||||
localName.c_str(), depends, commands, true);
|
localName.c_str(), depends, commands, true);
|
||||||
|
|
||||||
|
@ -864,7 +864,7 @@ cmGlobalUnixMakefileGenerator3
|
||||||
"preinstall", depends, commands, true);
|
"preinstall", depends, commands, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the clean rule
|
// add the clean rule
|
||||||
localName = lg->GetRelativeTargetDirectory(t->second);
|
localName = lg->GetRelativeTargetDirectory(t->second);
|
||||||
makeTargetName = localName;
|
makeTargetName = localName;
|
||||||
|
@ -1005,7 +1005,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
|
||||||
lg->AppendEcho(commands,"... all (the default if no target is provided)");
|
lg->AppendEcho(commands,"... all (the default if no target is provided)");
|
||||||
lg->AppendEcho(commands,"... clean");
|
lg->AppendEcho(commands,"... clean");
|
||||||
lg->AppendEcho(commands,"... depend");
|
lg->AppendEcho(commands,"... depend");
|
||||||
|
|
||||||
// Keep track of targets already listed.
|
// Keep track of targets already listed.
|
||||||
std::set<cmStdString> emittedTargets;
|
std::set<cmStdString> emittedTargets;
|
||||||
|
|
||||||
|
@ -1014,7 +1014,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
|
||||||
cmLocalUnixMakefileGenerator3 *lg2;
|
cmLocalUnixMakefileGenerator3 *lg2;
|
||||||
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
lg2 =
|
lg2 =
|
||||||
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
|
||||||
// for the passed in makefile or if this is the top Makefile wripte out
|
// for the passed in makefile or if this is the top Makefile wripte out
|
||||||
// the targets
|
// the targets
|
||||||
|
|
|
@ -22,19 +22,19 @@ class cmLocalUnixMakefileGenerator3;
|
||||||
* \brief Write a Unix makefiles.
|
* \brief Write a Unix makefiles.
|
||||||
*
|
*
|
||||||
* cmGlobalUnixMakefileGenerator3 manages UNIX build process for a tree
|
* cmGlobalUnixMakefileGenerator3 manages UNIX build process for a tree
|
||||||
|
|
||||||
|
|
||||||
The basic approach of this generator is to produce Makefiles that will all
|
The basic approach of this generator is to produce Makefiles that will all
|
||||||
be run with the current working directory set to the Home Output
|
be run with the current working directory set to the Home Output
|
||||||
directory. The one exception to this is the subdirectory Makefiles which are
|
directory. The one exception to this is the subdirectory Makefiles which are
|
||||||
created as a convenience and just cd up to the Home Output directory and
|
created as a convenience and just cd up to the Home Output directory and
|
||||||
invoke the main Makefiles.
|
invoke the main Makefiles.
|
||||||
|
|
||||||
The make process starts with Makefile. Makefile should only contain the
|
The make process starts with Makefile. Makefile should only contain the
|
||||||
targets the user is likely to invoke directly from a make command line. No
|
targets the user is likely to invoke directly from a make command line. No
|
||||||
internal targets should be in this file. Makefile2 contains the internal
|
internal targets should be in this file. Makefile2 contains the internal
|
||||||
targets that are required to make the process work.
|
targets that are required to make the process work.
|
||||||
|
|
||||||
Makefile2 in turn will recursively make targets in the correct order. Each
|
Makefile2 in turn will recursively make targets in the correct order. Each
|
||||||
target has its own directory <target>.dir and its own makefile build.make in
|
target has its own directory <target>.dir and its own makefile build.make in
|
||||||
that directory. Also in that directory is a couple makefiles per source file
|
that directory. Also in that directory is a couple makefiles per source file
|
||||||
|
@ -47,7 +47,7 @@ class cmLocalUnixMakefileGenerator3;
|
||||||
rescanned.
|
rescanned.
|
||||||
|
|
||||||
Rules for custom commands follow the same model as rules for source files.
|
Rules for custom commands follow the same model as rules for source files.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
|
class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
|
||||||
|
@ -64,13 +64,13 @@ public:
|
||||||
|
|
||||||
/** Get the documentation entry for this generator. */
|
/** Get the documentation entry for this generator. */
|
||||||
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
|
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
|
||||||
|
|
||||||
///! Create a local generator appropriate to this Global Generator3
|
///! Create a local generator appropriate to this Global Generator3
|
||||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to determine system infomation such as shared library
|
* Try to determine system infomation such as shared library
|
||||||
* extension, pthreads, byte order etc.
|
* extension, pthreads, byte order etc.
|
||||||
*/
|
*/
|
||||||
virtual void EnableLanguage(std::vector<std::string>const& languages,
|
virtual void EnableLanguage(std::vector<std::string>const& languages,
|
||||||
cmMakefile *, bool optional);
|
cmMakefile *, bool optional);
|
||||||
|
@ -78,11 +78,11 @@ public:
|
||||||
/**
|
/**
|
||||||
* Generate the all required files for building this project/tree. This
|
* Generate the all required files for building this project/tree. This
|
||||||
* basically creates a series of LocalGenerators for each directory and
|
* basically creates a series of LocalGenerators for each directory and
|
||||||
* requests that they Generate.
|
* requests that they Generate.
|
||||||
*/
|
*/
|
||||||
virtual void Generate();
|
virtual void Generate();
|
||||||
|
|
||||||
|
|
||||||
void WriteMainCMakefileLanguageRules(cmGeneratedFileStream& cmakefileStream,
|
void WriteMainCMakefileLanguageRules(cmGeneratedFileStream& cmakefileStream,
|
||||||
std::vector<cmLocalGenerator *> &);
|
std::vector<cmLocalGenerator *> &);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public:
|
||||||
cmLocalUnixMakefileGenerator3 *);
|
cmLocalUnixMakefileGenerator3 *);
|
||||||
|
|
||||||
// write the top lvel target rules
|
// write the top lvel target rules
|
||||||
void WriteConvenienceRules(std::ostream& ruleFileStream,
|
void WriteConvenienceRules(std::ostream& ruleFileStream,
|
||||||
std::set<cmStdString> &emitted);
|
std::set<cmStdString> &emitted);
|
||||||
|
|
||||||
/** Get the command to use for a target that has no rule. This is
|
/** Get the command to use for a target that has no rule. This is
|
||||||
|
@ -105,7 +105,7 @@ public:
|
||||||
// change the build command for speed
|
// change the build command for speed
|
||||||
virtual std::string GenerateBuildCommand
|
virtual std::string GenerateBuildCommand
|
||||||
(const char* makeProgram,
|
(const char* makeProgram,
|
||||||
const char *projectName, const char* additionalOptions,
|
const char *projectName, const char* additionalOptions,
|
||||||
const char *targetName,
|
const char *targetName,
|
||||||
const char* config, bool ignoreErrors, bool fast);
|
const char* config, bool ignoreErrors, bool fast);
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ public:
|
||||||
* IDE/editor.
|
* IDE/editor.
|
||||||
*/
|
*/
|
||||||
bool GetForceVerboseMakefiles() { return this->ForceVerboseMakefiles; }
|
bool GetForceVerboseMakefiles() { return this->ForceVerboseMakefiles; }
|
||||||
void SetForceVerboseMakefiles(bool enable)
|
void SetForceVerboseMakefiles(bool enable)
|
||||||
{this->ForceVerboseMakefiles=enable;}
|
{this->ForceVerboseMakefiles=enable;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -140,7 +140,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
|
||||||
|
|
||||||
// write the local Makefile
|
// write the local Makefile
|
||||||
this->WriteLocalMakefile();
|
this->WriteLocalMakefile();
|
||||||
|
|
||||||
// Write the cmake file with information for this directory.
|
// Write the cmake file with information for this directory.
|
||||||
this->WriteDirectoryInformationFile();
|
this->WriteDirectoryInformationFile();
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
|
||||||
void cmLocalUnixMakefileGenerator3::GetIndividualFileTargets
|
void cmLocalUnixMakefileGenerator3::GetIndividualFileTargets
|
||||||
(std::vector<std::string>& targets)
|
(std::vector<std::string>& targets)
|
||||||
{
|
{
|
||||||
for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
|
for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
|
||||||
this->LocalObjectFiles.begin();
|
this->LocalObjectFiles.begin();
|
||||||
lo != this->LocalObjectFiles.end(); ++lo)
|
lo != this->LocalObjectFiles.end(); ++lo)
|
||||||
{
|
{
|
||||||
|
@ -188,10 +188,10 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
|
||||||
{
|
{
|
||||||
ruleFileStream.SetCopyIfDifferent(true);
|
ruleFileStream.SetCopyIfDifferent(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the all rules
|
// write the all rules
|
||||||
this->WriteLocalAllRules(ruleFileStream);
|
this->WriteLocalAllRules(ruleFileStream);
|
||||||
|
|
||||||
// only write local targets unless at the top Keep track of targets already
|
// only write local targets unless at the top Keep track of targets already
|
||||||
// listed.
|
// listed.
|
||||||
std::set<cmStdString> emittedTargets;
|
std::set<cmStdString> emittedTargets;
|
||||||
|
@ -203,7 +203,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmGlobalUnixMakefileGenerator3 *gg =
|
cmGlobalUnixMakefileGenerator3 *gg =
|
||||||
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
|
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
|
||||||
gg->WriteConvenienceRules(ruleFileStream,emittedTargets);
|
gg->WriteConvenienceRules(ruleFileStream,emittedTargets);
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
|
||||||
|
|
||||||
// now write out the object rules
|
// now write out the object rules
|
||||||
// for each object file name
|
// for each object file name
|
||||||
for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
|
for (std::map<cmStdString, LocalObjectInfo>::iterator lo =
|
||||||
this->LocalObjectFiles.begin();
|
this->LocalObjectFiles.begin();
|
||||||
lo != this->LocalObjectFiles.end(); ++lo)
|
lo != this->LocalObjectFiles.end(); ++lo)
|
||||||
{
|
{
|
||||||
|
@ -261,7 +261,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
|
||||||
// add a help target as long as there isn;t a real target named help
|
// add a help target as long as there isn;t a real target named help
|
||||||
if(emittedTargets.insert("help").second)
|
if(emittedTargets.insert("help").second)
|
||||||
{
|
{
|
||||||
cmGlobalUnixMakefileGenerator3 *gg =
|
cmGlobalUnixMakefileGenerator3 *gg =
|
||||||
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
|
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
|
||||||
gg->WriteHelpRule(ruleFileStream,this);
|
gg->WriteHelpRule(ruleFileStream,this);
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ void cmLocalUnixMakefileGenerator3
|
||||||
localName += "/rule";
|
localName += "/rule";
|
||||||
commands.clear();
|
commands.clear();
|
||||||
depends.clear();
|
depends.clear();
|
||||||
|
|
||||||
// Build the target for this pass.
|
// Build the target for this pass.
|
||||||
std::string makefile2 = cmake::GetCMakeFilesDirectoryPostSlash();
|
std::string makefile2 = cmake::GetCMakeFilesDirectoryPostSlash();
|
||||||
makefile2 += "Makefile2";
|
makefile2 += "Makefile2";
|
||||||
|
@ -364,7 +364,7 @@ void cmLocalUnixMakefileGenerator3
|
||||||
cmLocalGenerator::START_OUTPUT);
|
cmLocalGenerator::START_OUTPUT);
|
||||||
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
|
||||||
localName.c_str(), depends, commands, true);
|
localName.c_str(), depends, commands, true);
|
||||||
|
|
||||||
// Add a target with the canonical name (no prefix, suffix or path).
|
// Add a target with the canonical name (no prefix, suffix or path).
|
||||||
if(localName != t->second.GetName())
|
if(localName != t->second.GetName())
|
||||||
{
|
{
|
||||||
|
@ -378,7 +378,7 @@ void cmLocalUnixMakefileGenerator3
|
||||||
std::string makefileName = this->GetRelativeTargetDirectory(t->second);
|
std::string makefileName = this->GetRelativeTargetDirectory(t->second);
|
||||||
makefileName += "/build.make";
|
makefileName += "/build.make";
|
||||||
// make sure the makefile name is suitable for a makefile
|
// make sure the makefile name is suitable for a makefile
|
||||||
std::string makeTargetName =
|
std::string makeTargetName =
|
||||||
this->GetRelativeTargetDirectory(t->second);
|
this->GetRelativeTargetDirectory(t->second);
|
||||||
makeTargetName += "/build";
|
makeTargetName += "/build";
|
||||||
localName = t->second.GetName();
|
localName = t->second.GetName();
|
||||||
|
@ -647,7 +647,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
makefileStream
|
makefileStream
|
||||||
<< "# The CMake executable.\n"
|
<< "# The CMake executable.\n"
|
||||||
<< "CMAKE_COMMAND = "
|
<< "CMAKE_COMMAND = "
|
||||||
<< this->Convert(cmakecommand.c_str(), FULL, SHELL).c_str()
|
<< this->Convert(cmakecommand.c_str(), FULL, SHELL).c_str()
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< "\n";
|
<< "\n";
|
||||||
makefileStream
|
makefileStream
|
||||||
|
@ -656,7 +656,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
<< this->Convert(cmakecommand.c_str(),FULL,SHELL).c_str()
|
<< this->Convert(cmakecommand.c_str(),FULL,SHELL).c_str()
|
||||||
<< " -E remove -f\n"
|
<< " -E remove -f\n"
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
|
||||||
if(const char* edit_cmd =
|
if(const char* edit_cmd =
|
||||||
this->Makefile->GetDefinition("CMAKE_EDIT_COMMAND"))
|
this->Makefile->GetDefinition("CMAKE_EDIT_COMMAND"))
|
||||||
{
|
{
|
||||||
|
@ -722,7 +722,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
// "VERBOSE=1" to be added as a make variable which will change the
|
// "VERBOSE=1" to be added as a make variable which will change the
|
||||||
// name of this special target. This gives a make-time choice to
|
// name of this special target. This gives a make-time choice to
|
||||||
// the user.
|
// the user.
|
||||||
if((this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
|
if((this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
|
||||||
|| (gg->GetForceVerboseMakefiles()))
|
|| (gg->GetForceVerboseMakefiles()))
|
||||||
{
|
{
|
||||||
makefileStream
|
makefileStream
|
||||||
|
@ -872,7 +872,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
// Add a dependency on the rule file itself unless an option to skip
|
// Add a dependency on the rule file itself unless an option to skip
|
||||||
// it is specifically enabled by the user or project.
|
// it is specifically enabled by the user or project.
|
||||||
const char* nodep =
|
const char* nodep =
|
||||||
this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY");
|
this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY");
|
||||||
if(!nodep || cmSystemTools::IsOff(nodep))
|
if(!nodep || cmSystemTools::IsOff(nodep))
|
||||||
{
|
{
|
||||||
|
@ -969,7 +969,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
// Build the command line in a single string.
|
// Build the command line in a single string.
|
||||||
const cmCustomCommandLine& commandLine = *cl;
|
const cmCustomCommandLine& commandLine = *cl;
|
||||||
std::string cmd = GetRealLocation(commandLine[0].c_str(),
|
std::string cmd = GetRealLocation(commandLine[0].c_str(),
|
||||||
this->ConfigurationName.c_str());
|
this->ConfigurationName.c_str());
|
||||||
if (cmd.size())
|
if (cmd.size())
|
||||||
{
|
{
|
||||||
|
@ -1283,7 +1283,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
|
|
||||||
// see if the variable has been defined before and return
|
// see if the variable has been defined before and return
|
||||||
// the modified version of the variable
|
// the modified version of the variable
|
||||||
std::map<cmStdString, cmStdString>::iterator i =
|
std::map<cmStdString, cmStdString>::iterator i =
|
||||||
this->MakeVariableMap.find(unmodified);
|
this->MakeVariableMap.find(unmodified);
|
||||||
if(i != this->MakeVariableMap.end())
|
if(i != this->MakeVariableMap.end())
|
||||||
{
|
{
|
||||||
|
@ -1404,7 +1404,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
|
||||||
dirInfoFile += "/CMakeDirectoryInformation.cmake";
|
dirInfoFile += "/CMakeDirectoryInformation.cmake";
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
if(!ftc->FileTimeCompare(internalDependFile.c_str(),
|
if(!ftc->FileTimeCompare(internalDependFile.c_str(),
|
||||||
dirInfoFile.c_str(), &result) || result < 0)
|
dirInfoFile.c_str(), &result) || result < 0)
|
||||||
{
|
{
|
||||||
if(verbose)
|
if(verbose)
|
||||||
|
@ -1418,7 +1418,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
|
||||||
needRescanDirInfo = true;
|
needRescanDirInfo = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the implicit dependencies to see if they are up to date.
|
// Check the implicit dependencies to see if they are up to date.
|
||||||
// The build.make file may have explicit dependencies for the object
|
// The build.make file may have explicit dependencies for the object
|
||||||
// files but these will not affect the scanning process so they need
|
// files but these will not affect the scanning process so they need
|
||||||
|
@ -1433,11 +1433,11 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
|
||||||
// cmDependsC::Check() fills the vector validDependencies() with the
|
// cmDependsC::Check() fills the vector validDependencies() with the
|
||||||
// dependencies for those files where they are still valid, i.e. neither
|
// dependencies for those files where they are still valid, i.e. neither
|
||||||
// the files themselves nor any files they depend on have changed.
|
// the files themselves nor any files they depend on have changed.
|
||||||
// We don't do that if the CMakeDirectoryInformation.cmake file has
|
// We don't do that if the CMakeDirectoryInformation.cmake file has
|
||||||
// changed, because then potentially all dependencies have changed.
|
// changed, because then potentially all dependencies have changed.
|
||||||
// This information is given later on to cmDependsC, which then only
|
// This information is given later on to cmDependsC, which then only
|
||||||
// rescans the files where it did not get valid dependencies via this
|
// rescans the files where it did not get valid dependencies via this
|
||||||
// dependency vector. This means that in the normal case, when only
|
// dependency vector. This means that in the normal case, when only
|
||||||
// few or one file have been edited, then also only this one file is
|
// few or one file have been edited, then also only this one file is
|
||||||
// actually scanned again, instead of all files for this target.
|
// actually scanned again, instead of all files for this target.
|
||||||
needRescanDependencies = !checker.Check(dependFile.c_str(),
|
needRescanDependencies = !checker.Check(dependFile.c_str(),
|
||||||
|
@ -1485,7 +1485,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
haveDirectoryInfo = true;
|
haveDirectoryInfo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lookup useful directory information.
|
// Lookup useful directory information.
|
||||||
if(haveDirectoryInfo)
|
if(haveDirectoryInfo)
|
||||||
{
|
{
|
||||||
|
@ -1545,11 +1545,11 @@ cmLocalUnixMakefileGenerator3
|
||||||
this->WriteDisclaimer(ruleFileStream);
|
this->WriteDisclaimer(ruleFileStream);
|
||||||
this->WriteDisclaimer(internalRuleFileStream);
|
this->WriteDisclaimer(internalRuleFileStream);
|
||||||
|
|
||||||
// for each language we need to scan, scan it
|
// for each language we need to scan, scan it
|
||||||
const char *langStr = mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES");
|
const char *langStr = mf->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES");
|
||||||
std::vector<std::string> langs;
|
std::vector<std::string> langs;
|
||||||
cmSystemTools::ExpandListArgument(langStr, langs);
|
cmSystemTools::ExpandListArgument(langStr, langs);
|
||||||
for (std::vector<std::string>::iterator li =
|
for (std::vector<std::string>::iterator li =
|
||||||
langs.begin(); li != langs.end(); ++li)
|
langs.begin(); li != langs.end(); ++li)
|
||||||
{
|
{
|
||||||
// construct the checker
|
// construct the checker
|
||||||
|
@ -1572,7 +1572,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
scanner = new cmDependsJava();
|
scanner = new cmDependsJava();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (scanner)
|
if (scanner)
|
||||||
{
|
{
|
||||||
scanner->SetLocalGenerator(this);
|
scanner->SetLocalGenerator(this);
|
||||||
|
@ -1686,25 +1686,25 @@ void cmLocalUnixMakefileGenerator3
|
||||||
cmLocalUnixMakefileGenerator3::EchoGlobal);
|
cmLocalUnixMakefileGenerator3::EchoGlobal);
|
||||||
|
|
||||||
// Global targets store their rules in pre- and post-build commands.
|
// Global targets store their rules in pre- and post-build commands.
|
||||||
this->AppendCustomDepends(depends,
|
this->AppendCustomDepends(depends,
|
||||||
glIt->second.GetPreBuildCommands());
|
glIt->second.GetPreBuildCommands());
|
||||||
this->AppendCustomDepends(depends,
|
this->AppendCustomDepends(depends,
|
||||||
glIt->second.GetPostBuildCommands());
|
glIt->second.GetPostBuildCommands());
|
||||||
this->AppendCustomCommands(commands,
|
this->AppendCustomCommands(commands,
|
||||||
glIt->second.GetPreBuildCommands(),
|
glIt->second.GetPreBuildCommands(),
|
||||||
&glIt->second,
|
&glIt->second,
|
||||||
cmLocalGenerator::START_OUTPUT);
|
cmLocalGenerator::START_OUTPUT);
|
||||||
this->AppendCustomCommands(commands,
|
this->AppendCustomCommands(commands,
|
||||||
glIt->second.GetPostBuildCommands(),
|
glIt->second.GetPostBuildCommands(),
|
||||||
&glIt->second,
|
&glIt->second,
|
||||||
cmLocalGenerator::START_OUTPUT);
|
cmLocalGenerator::START_OUTPUT);
|
||||||
std::string targetName = glIt->second.GetName();
|
std::string targetName = glIt->second.GetName();
|
||||||
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
|
this->WriteMakeRule(ruleFileStream, targetString.c_str(),
|
||||||
targetName.c_str(), depends, commands, true);
|
targetName.c_str(), depends, commands, true);
|
||||||
|
|
||||||
// Provide a "/fast" version of the target.
|
// Provide a "/fast" version of the target.
|
||||||
depends.clear();
|
depends.clear();
|
||||||
if((targetName == "install")
|
if((targetName == "install")
|
||||||
|| (targetName == "install_local")
|
|| (targetName == "install_local")
|
||||||
|| (targetName == "install_strip"))
|
|| (targetName == "install_strip"))
|
||||||
{
|
{
|
||||||
|
@ -1738,7 +1738,7 @@ void cmLocalUnixMakefileGenerator3
|
||||||
progressDir += cmake::GetCMakeFilesDirectory();
|
progressDir += cmake::GetCMakeFilesDirectory();
|
||||||
{
|
{
|
||||||
cmOStringStream progCmd;
|
cmOStringStream progCmd;
|
||||||
progCmd <<
|
progCmd <<
|
||||||
"$(CMAKE_COMMAND) -E cmake_progress_start ";
|
"$(CMAKE_COMMAND) -E cmake_progress_start ";
|
||||||
progCmd << this->Convert(progressDir.c_str(),
|
progCmd << this->Convert(progressDir.c_str(),
|
||||||
cmLocalGenerator::FULL,
|
cmLocalGenerator::FULL,
|
||||||
|
@ -1833,8 +1833,8 @@ void cmLocalUnixMakefileGenerator3
|
||||||
this->CreateCDCommand(commands,
|
this->CreateCDCommand(commands,
|
||||||
this->Makefile->GetHomeOutputDirectory(),
|
this->Makefile->GetHomeOutputDirectory(),
|
||||||
cmLocalGenerator::START_OUTPUT);
|
cmLocalGenerator::START_OUTPUT);
|
||||||
this->WriteMakeRule(ruleFileStream, "clear depends",
|
this->WriteMakeRule(ruleFileStream, "clear depends",
|
||||||
"depend",
|
"depend",
|
||||||
depends, commands, true);
|
depends, commands, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2048,7 +2048,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
cmd += "$(MAKE) -f ";
|
cmd += "$(MAKE) -f ";
|
||||||
cmd += this->Convert(makefile,NONE,SHELL);
|
cmd += this->Convert(makefile,NONE,SHELL);
|
||||||
cmd += " ";
|
cmd += " ";
|
||||||
|
|
||||||
// Pass down verbosity level.
|
// Pass down verbosity level.
|
||||||
if(this->GetMakeSilentFlag().size())
|
if(this->GetMakeSilentFlag().size())
|
||||||
{
|
{
|
||||||
|
@ -2125,7 +2125,7 @@ cmLocalUnixMakefileGenerator3
|
||||||
std::string
|
std::string
|
||||||
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
|
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Split the path into its components.
|
// Split the path into its components.
|
||||||
std::vector<std::string> components;
|
std::vector<std::string> components;
|
||||||
cmSystemTools::SplitPath(p, components);
|
cmSystemTools::SplitPath(p, components);
|
||||||
|
@ -2224,7 +2224,7 @@ void cmLocalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this->UnixCD)
|
if(!this->UnixCD)
|
||||||
{
|
{
|
||||||
// On Windows we must perform each step separately and then change
|
// On Windows we must perform each step separately and then change
|
||||||
|
|
Loading…
Reference in New Issue