diff options
author | Alexander Neundorf <neundorf@kde.org> | 2009-10-12 17:44:42 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2009-10-12 17:44:42 (GMT) |
commit | 45b8f2e441ab8be19232725bda312a18c489edb8 (patch) | |
tree | 911688ec03b9a8d41b6c3c8f64049cabb3404fac /Source/cmExtraCodeBlocksGenerator.cxx | |
parent | 03d55fb4c7be3a691ca4b8c61f9f3a20e64a0e3e (diff) | |
download | CMake-45b8f2e441ab8be19232725bda312a18c489edb8.zip CMake-45b8f2e441ab8be19232725bda312a18c489edb8.tar.gz CMake-45b8f2e441ab8be19232725bda312a18c489edb8.tar.bz2 |
fix indentation
Alex
Diffstat (limited to 'Source/cmExtraCodeBlocksGenerator.cxx')
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 149 |
1 files changed, 74 insertions, 75 deletions
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 7f2605f..e3d29fb 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -194,7 +194,7 @@ void Tree::BuildVirtualFolderImpl(std::string& virtualFolders, { virtualFolders += "CMake Files\\" + prefix + path + "\\;"; for (std::vector<Tree>::const_iterator it = folders.begin(); - it != folders.end(); + it != folders.end(); ++it) { it->BuildVirtualFolderImpl(virtualFolders, prefix + path + "\\"); @@ -276,32 +276,31 @@ void cmExtraCodeBlocksGenerator // Convert for (std::vector<std::string>::const_iterator jt = listFiles.begin(); - jt != listFiles.end(); - ++jt) - { - const std::string &relative = - cmSystemTools::RelativePath( + jt != listFiles.end(); + ++jt) + { + const std::string &relative = cmSystemTools::RelativePath( it->second[0]->GetMakefile()->GetHomeDirectory(), jt->c_str()); - std::vector<std::string> splitted; - cmSystemTools::SplitPath(relative.c_str(), splitted, false); - // Split filename from path - std::string fileName = *(splitted.end()-1); - splitted.erase(splitted.end() - 1, splitted.end()); - - // We don't want paths with ".." in them - // reasons are that we don't want files outside the project - // TODO: the path should be normalized first though - // We don't want paths with CMakeFiles in them - // or do we? - // In speedcrunch those where purely internal - if (splitted.size() >= 1 - && relative.find("..") == std::string::npos - && relative.find("CMakeFiles") == std::string::npos) - { - tree.InsertPath(splitted, 1, fileName); - } - } + std::vector<std::string> splitted; + cmSystemTools::SplitPath(relative.c_str(), splitted, false); + // Split filename from path + std::string fileName = *(splitted.end()-1); + splitted.erase(splitted.end() - 1, splitted.end()); + + // We don't want paths with ".." in them + // reasons are that we don't want files outside the project + // TODO: the path should be normalized first though + // We don't want paths with CMakeFiles in them + // or do we? + // In speedcrunch those where purely internal + if (splitted.size() >= 1 + && relative.find("..") == std::string::npos + && relative.find("CMakeFiles") == std::string::npos) + { + tree.InsertPath(splitted, 1, fileName); + } + } } // Now build a virtual tree string @@ -337,68 +336,68 @@ void cmExtraCodeBlocksGenerator for (cmTargets::iterator ti = targets.begin(); ti != targets.end(); ti++) { - switch(ti->second.GetType()) + switch(ti->second.GetType()) { - case cmTarget::GLOBAL_TARGET: + case cmTarget::GLOBAL_TARGET: + { + bool insertTarget = false; + // Only add the global targets from CMAKE_BINARY_DIR, + // not from the subdirs + if (strcmp(makefile->GetStartOutputDirectory(), + makefile->GetHomeOutputDirectory())==0) { - bool insertTarget = false; - // Only add the global targets from CMAKE_BINARY_DIR, - // not from the subdirs - if (strcmp(makefile->GetStartOutputDirectory(), - makefile->GetHomeOutputDirectory())==0) + insertTarget = true; + // only add the "edit_cache" target if it's not ccmake, because + // this will not work within the IDE + if (ti->first == "edit_cache") { - insertTarget = true; - // only add the "edit_cache" target if it's not ccmake, because - // this will not work within the IDE - if (ti->first == "edit_cache") - { - if (strstr(makefile->GetRequiredDefinition + if (strstr(makefile->GetRequiredDefinition ("CMAKE_EDIT_COMMAND"), "ccmake")!=NULL) - { - insertTarget = false; - } + { + insertTarget = false; } } - if (insertTarget) - { - this->AppendTarget(fout, ti->first.c_str(), 0, + } + if (insertTarget) + { + this->AppendTarget(fout, ti->first.c_str(), 0, make.c_str(), makefile, compiler.c_str()); - } } - break; - case cmTarget::UTILITY: - // Add all utility targets, except the Nightly/Continuous/ - // Experimental-"sub"targets as e.g. NightlyStart - if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly")) + } + break; + case cmTarget::UTILITY: + // Add all utility targets, except the Nightly/Continuous/ + // Experimental-"sub"targets as e.g. NightlyStart + if (((ti->first.find("Nightly")==0) &&(ti->first!="Nightly")) || ((ti->first.find("Continuous")==0)&&(ti->first!="Continuous")) || ((ti->first.find("Experimental")==0) && (ti->first!="Experimental"))) - { - break; - } - - this->AppendTarget(fout, ti->first.c_str(), 0, - make.c_str(), makefile, compiler.c_str()); - break; - case cmTarget::EXECUTABLE: - case cmTarget::STATIC_LIBRARY: - case cmTarget::SHARED_LIBRARY: - case cmTarget::MODULE_LIBRARY: { - this->AppendTarget(fout, ti->first.c_str(), &ti->second, - make.c_str(), makefile, compiler.c_str()); - std::string fastTarget = ti->first; - fastTarget += "/fast"; - this->AppendTarget(fout, fastTarget.c_str(), &ti->second, - make.c_str(), makefile, compiler.c_str()); - } - break; - // ignore these: - case cmTarget::INSTALL_FILES: - case cmTarget::INSTALL_PROGRAMS: - case cmTarget::INSTALL_DIRECTORY: - default: break; + } + + this->AppendTarget(fout, ti->first.c_str(), 0, + make.c_str(), makefile, compiler.c_str()); + break; + case cmTarget::EXECUTABLE: + case cmTarget::STATIC_LIBRARY: + case cmTarget::SHARED_LIBRARY: + case cmTarget::MODULE_LIBRARY: + { + this->AppendTarget(fout, ti->first.c_str(), &ti->second, + make.c_str(), makefile, compiler.c_str()); + std::string fastTarget = ti->first; + fastTarget += "/fast"; + this->AppendTarget(fout, fastTarget.c_str(), &ti->second, + make.c_str(), makefile, compiler.c_str()); + } + break; + // ignore these: + case cmTarget::INSTALL_FILES: + case cmTarget::INSTALL_PROGRAMS: + case cmTarget::INSTALL_DIRECTORY: + default: + break; } } } @@ -676,7 +675,7 @@ int cmExtraCodeBlocksGenerator::GetCBTargetType(cmTarget* target) return 2; } else if ((target->GetType()==cmTarget::SHARED_LIBRARY) - || (target->GetType()==cmTarget::MODULE_LIBRARY)) + || (target->GetType()==cmTarget::MODULE_LIBRARY)) { return 3; } |