Kate: Port API to cmLocalGenerator.

This commit is contained in:
Stephen Kelly 2015-10-07 00:49:19 +02:00
parent e46ef270ed
commit 10cf42f5ae
2 changed files with 17 additions and 10 deletions

View File

@ -53,13 +53,15 @@ void cmExtraKateGenerator::Generate()
this->GetPathBasename(mf->GetHomeOutputDirectory()));
this->UseNinja = (this->GlobalGenerator->GetName() == "Ninja");
this->CreateKateProjectFile(mf);
this->CreateDummyKateProjectFile(mf);
this->CreateKateProjectFile(lg);
this->CreateDummyKateProjectFile(lg);
}
void cmExtraKateGenerator::CreateKateProjectFile(const cmMakefile* mf) const
void cmExtraKateGenerator::CreateKateProjectFile(
const cmLocalGenerator* lg) const
{
const cmMakefile* mf = lg->GetMakefile();
std::string filename = mf->GetHomeOutputDirectory();
filename += "/.kateproject";
cmGeneratedFileStream fout(filename.c_str());
@ -82,9 +84,10 @@ void cmExtraKateGenerator::CreateKateProjectFile(const cmMakefile* mf) const
void
cmExtraKateGenerator::WriteTargets(const cmMakefile* mf,
cmExtraKateGenerator::WriteTargets(const cmLocalGenerator* lg,
cmGeneratedFileStream& fout) const
{
cmMakefile* mf = lg->GetMakefile();
const std::string make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
const std::string makeArgs = mf->GetSafeDefinition(
"CMAKE_KATE_MAKE_ARGUMENTS");
@ -234,8 +237,10 @@ cmExtraKateGenerator::AppendTarget(cmGeneratedFileStream& fout,
void
cmExtraKateGenerator::CreateDummyKateProjectFile(const cmMakefile* mf) const
cmExtraKateGenerator::CreateDummyKateProjectFile(
const cmLocalGenerator* lg) const
{
cmMakefile* mf = lg->GetMakefile();
std::string filename = mf->GetHomeOutputDirectory();
filename += "/";
filename += this->ProjectName;
@ -252,8 +257,9 @@ cmExtraKateGenerator::CreateDummyKateProjectFile(const cmMakefile* mf) const
std::string
cmExtraKateGenerator::GenerateFilesString(const cmMakefile* mf) const
cmExtraKateGenerator::GenerateFilesString(const cmLocalGenerator* lg) const
{
cmMakefile* mf = lg->GetMakefile();
std::string s = mf->GetHomeDirectory();
s += "/.git";
if(cmSystemTools::FileExists(s.c_str()))

View File

@ -39,9 +39,10 @@ public:
virtual void Generate();
private:
void CreateKateProjectFile(const cmMakefile* mf) const;
void CreateDummyKateProjectFile(const cmMakefile* mf) const;
void WriteTargets(const cmMakefile* mf, cmGeneratedFileStream& fout) const;
void CreateKateProjectFile(const cmLocalGenerator* lg) const;
void CreateDummyKateProjectFile(const cmLocalGenerator* lg) const;
void WriteTargets(const cmLocalGenerator* lg,
cmGeneratedFileStream& fout) const;
void AppendTarget(cmGeneratedFileStream& fout,
const std::string& target,
const std::string& make,
@ -49,7 +50,7 @@ private:
const std::string& path,
const char* homeOutputDir) const;
std::string GenerateFilesString(const cmMakefile* mf) const;
std::string GenerateFilesString(const cmLocalGenerator* lg) const;
std::string GetPathBasename(const std::string& path) const;
std::string GenerateProjectName(const std::string& name,
const std::string& type,