diff options
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 589bf53..fbfbccc 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -248,7 +248,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // We don't want paths with CMakeFiles in them // or do we? // In speedcrunch those where purely internal - if (splitted.size() >= 1 && + if (!splitted.empty() && relative.find("CMakeFiles") == std::string::npos) { tree.InsertPath(splitted, 1, fileName); } @@ -289,8 +289,8 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( xml.StartElement("Build"); - this->AppendTarget(xml, "all", 0, make.c_str(), lgs[0], compiler.c_str(), - makeArgs); + this->AppendTarget(xml, "all", CM_NULLPTR, make.c_str(), lgs[0], + compiler.c_str(), makeArgs); // add all executable and library targets and some of the GLOBAL // and UTILITY targets @@ -306,7 +306,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( // not from the subdirs if (strcmp((*lg)->GetCurrentBinaryDirectory(), (*lg)->GetBinaryDirectory()) == 0) { - this->AppendTarget(xml, targetName, 0, make.c_str(), *lg, + this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, compiler.c_str(), makeArgs); } } break; @@ -322,7 +322,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( break; } - this->AppendTarget(xml, targetName, 0, make.c_str(), *lg, + this->AppendTarget(xml, targetName, CM_NULLPTR, make.c_str(), *lg, compiler.c_str(), makeArgs); break; case cmState::EXECUTABLE: @@ -376,8 +376,10 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (std::vector<cmSourceFile*>::const_iterator si = sources.begin(); si != sources.end(); si++) { - // don't add source files which have the GENERATED property set: - if ((*si)->GetPropertyAsBool("GENERATED")) { + // don't add source files from UTILITY target which have the + // GENERATED property set: + if (gt->GetType() == cmState::UTILITY && + (*si)->GetPropertyAsBool("GENERATED")) { continue; } @@ -513,7 +515,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget( xml.StartElement("Target"); xml.Attribute("title", targetName); - if (target != 0) { + if (target != CM_NULLPTR) { int cbTargetType = this->GetCBTargetType(target); std::string workingDir = lg->GetCurrentBinaryDirectory(); if (target->GetType() == cmState::EXECUTABLE) { @@ -521,12 +523,12 @@ void cmExtraCodeBlocksGenerator::AppendTarget( // set the working directory to this dir. const char* runtimeOutputDir = makefile->GetDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"); - if (runtimeOutputDir != 0) { + if (runtimeOutputDir != CM_NULLPTR) { workingDir = runtimeOutputDir; } else { const char* executableOutputDir = makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); - if (executableOutputDir != 0) { + if (executableOutputDir != CM_NULLPTR) { workingDir = executableOutputDir; } } @@ -659,11 +661,11 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf) // projects with C/C++ and Fortran are handled as C/C++ projects bool pureFortran = false; std::string compilerIdVar; - if (this->GlobalGenerator->GetLanguageEnabled("CXX") == true) { + if (this->GlobalGenerator->GetLanguageEnabled("CXX")) { compilerIdVar = "CMAKE_CXX_COMPILER_ID"; - } else if (this->GlobalGenerator->GetLanguageEnabled("C") == true) { + } else if (this->GlobalGenerator->GetLanguageEnabled("C")) { compilerIdVar = "CMAKE_C_COMPILER_ID"; - } else if (this->GlobalGenerator->GetLanguageEnabled("Fortran") == true) { + } else if (this->GlobalGenerator->GetLanguageEnabled("Fortran")) { compilerIdVar = "CMAKE_Fortran_COMPILER_ID"; pureFortran = true; } @@ -671,7 +673,7 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf) std::string compilerId = mf->GetSafeDefinition(compilerIdVar); std::string compiler = "gcc"; // default to gcc if (compilerId == "MSVC") { - if (mf->IsDefinitionSet("MSVC10") == true) { + if (mf->IsDefinitionSet("MSVC10")) { compiler = "msvc10"; } else { compiler = "msvc8"; @@ -733,7 +735,7 @@ std::string cmExtraCodeBlocksGenerator::BuildMakeCommand( const std::string& makeFlags) { std::string command = make; - if (makeFlags.size() > 0) { + if (!makeFlags.empty()) { command += " "; command += makeFlags; } |