summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeBlocksGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-10-12 14:26:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-10-12 14:26:15 (GMT)
commit762108f3ec60ca717cdba369dffc84459a7e3282 (patch)
treec5c294b462c953d9087bb9dc85ad89a2889af19f /Source/cmExtraCodeBlocksGenerator.cxx
parentf3fa7c6bc364a523ba7a437402603fd84c6c9e4b (diff)
parent223d0efe55ff66f6ceb25ecdfbd1d915c76af548 (diff)
downloadCMake-762108f3ec60ca717cdba369dffc84459a7e3282.zip
CMake-762108f3ec60ca717cdba369dffc84459a7e3282.tar.gz
CMake-762108f3ec60ca717cdba369dffc84459a7e3282.tar.bz2
Merge topic 'add-cmLocalGenerator-API'
223d0efe Remove some needless GetMakefile() calls. a367416c cmLocalGenerator: Add current source directory accessor. bbef3c2d cmLocalGenerator: Add current binary directory accessor. 12cb3bdc cmLocalGenerator: Add Home directory accessors. 72efa15d Eclipse: Port API to cmLocalGenerator. f2a641d6 Kate: Remove unused variables. 10cf42f5 Kate: Port API to cmLocalGenerator. e46ef270 export: Port internal method to cmGeneratorTarget. 53d3a1c9 cmMakefile: Remove unused GetProjectName calls. 4ab2750c cmLocalGenerator: Add GetProjectName method. c8187f41 cmCPluginAPI: Inline code to get project name. 8c6e6dd3 cmMakefile: Inline initialization of project name. 27916f2c cmLocalGenerator: Add cmake instance accessor.
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 609764c..0406644 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -76,9 +76,8 @@ void cmExtraCodeBlocksGenerator::Generate()
void cmExtraCodeBlocksGenerator::CreateProjectFile(
const std::vector<cmLocalGenerator*>& lgs)
{
- const cmMakefile* mf=lgs[0]->GetMakefile();
- std::string outputDir=mf->GetCurrentBinaryDirectory();
- std::string projectName=mf->GetProjectName();
+ std::string outputDir=lgs[0]->GetCurrentBinaryDirectory();
+ std::string projectName=lgs[0]->GetProjectName();
std::string filename=outputDir+"/";
filename+=projectName+".cbp";
@@ -273,7 +272,7 @@ void cmExtraCodeBlocksGenerator
}
const std::string &relative = cmSystemTools::RelativePath(
- it->second[0]->GetMakefile()->GetHomeDirectory(),
+ it->second[0]->GetSourceDirectory(),
jt->c_str());
std::vector<std::string> splitted;
cmSystemTools::SplitPath(relative, splitted, false);
@@ -297,7 +296,7 @@ void cmExtraCodeBlocksGenerator
tree.BuildVirtualFolder(virtualFolders);
// And one for <Unit>
std::string unitFiles;
- tree.BuildUnit(unitFiles, std::string(mf->GetHomeDirectory()) + "/");
+ tree.BuildUnit(unitFiles, std::string(lgs[0]->GetSourceDirectory()) + "/");
// figure out the compiler
std::string compiler = this->GetCBCompilerId(mf);
@@ -307,7 +306,7 @@ void cmExtraCodeBlocksGenerator
"<CodeBlocks_project_file>\n"
" <FileVersion major=\"1\" minor=\"6\" />\n"
" <Project>\n"
- " <Option title=\"" << mf->GetProjectName()<<"\" />\n"
+ " <Option title=\"" << lgs[0]->GetProjectName()<<"\" />\n"
" <Option makefile_is_custom=\"1\" />\n"
" <Option compiler=\"" << compiler << "\" />\n"
" "<<virtualFolders<<"\n"
@@ -331,8 +330,8 @@ void cmExtraCodeBlocksGenerator
{
// Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs
- if (strcmp(makefile->GetCurrentBinaryDirectory(),
- makefile->GetHomeOutputDirectory())==0)
+ if (strcmp((*lg)->GetCurrentBinaryDirectory(),
+ (*lg)->GetBinaryDirectory())==0)
{
this->AppendTarget(fout, ti->first, 0,
make.c_str(), *lg, compiler.c_str());
@@ -524,11 +523,10 @@ std::string cmExtraCodeBlocksGenerator::CreateDummyTargetFile(
cmLocalGenerator* lg,
cmTarget* target) const
{
- cmMakefile *mf = lg->GetMakefile();
// this file doesn't seem to be used by C::B in custom makefile mode,
// but we generate a unique file for each OBJECT library so in case
// C::B uses it in some way, the targets don't interfere with each other.
- std::string filename = mf->GetCurrentBinaryDirectory();
+ std::string filename = lg->GetCurrentBinaryDirectory();
filename += "/";
filename += lg->GetTargetDirectory(*target);
filename += "/";
@@ -555,14 +553,14 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
const char* compiler)
{
cmMakefile const* makefile = lg->GetMakefile();
- std::string makefileName = makefile->GetCurrentBinaryDirectory();
+ std::string makefileName = lg->GetCurrentBinaryDirectory();
makefileName += "/Makefile";
fout<<" <Target title=\"" << targetName << "\">\n";
if (target!=0)
{
int cbTargetType = this->GetCBTargetType(target);
- std::string workingDir = makefile->GetCurrentBinaryDirectory();
+ std::string workingDir = lg->GetCurrentBinaryDirectory();
if ( target->GetType()==cmTarget::EXECUTABLE)
{
// Determine the directory where the executable target is created, and
@@ -659,7 +657,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
else // e.g. all and the GLOBAL and UTILITY targets
{
fout<<" <Option working_dir=\""
- << makefile->GetCurrentBinaryDirectory() << "\" />\n"
+ << lg->GetCurrentBinaryDirectory() << "\" />\n"
<<" <Option type=\"" << 4 << "\" />\n";
}