| 170 | } |
| 171 | |
| 172 | void cmExtraSublimeTextGenerator::AppendAllTargets( |
| 173 | std::vector<cmLocalGenerator*> const& lgs, cmMakefile const* mf, |
| 174 | cmGeneratedFileStream& fout, MapSourceFileFlags& sourceFileFlags) |
| 175 | { |
| 176 | std::string const& make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); |
| 177 | std::string compiler; |
| 178 | if (!lgs.empty()) { |
| 179 | this->AppendTarget(fout, "all", lgs[0], nullptr, make.c_str(), mf, |
| 180 | compiler.c_str(), sourceFileFlags, true); |
| 181 | this->AppendTarget(fout, "clean", lgs[0], nullptr, make.c_str(), mf, |
| 182 | compiler.c_str(), sourceFileFlags, false); |
| 183 | } |
| 184 | |
| 185 | // add all executable and library targets and some of the GLOBAL |
| 186 | // and UTILITY targets |
| 187 | for (cmLocalGenerator* lg : lgs) { |
| 188 | cmMakefile* makefile = lg->GetMakefile(); |
| 189 | auto const& targets = lg->GetGeneratorTargets(); |
| 190 | for (auto const& target : targets) { |
| 191 | std::string targetName = target->GetName(); |
| 192 | switch (target->GetType()) { |
| 193 | case cmStateEnums::GLOBAL_TARGET: { |
| 194 | // Only add the global targets from CMAKE_BINARY_DIR, |
| 195 | // not from the subdirs |
| 196 | if (lg->GetCurrentBinaryDirectory() == lg->GetBinaryDirectory()) { |
| 197 | this->AppendTarget(fout, targetName, lg, nullptr, make.c_str(), |
| 198 | makefile, compiler.c_str(), sourceFileFlags, |
| 199 | false); |
| 200 | } |
| 201 | } break; |
| 202 | case cmStateEnums::UTILITY: |
| 203 | // Add all utility targets, except the Nightly/Continuous/ |
| 204 | // Experimental-"sub"targets as e.g. NightlyStart |
| 205 | if ((cmHasLiteralPrefix(targetName, "Nightly") && |
| 206 | (targetName != "Nightly")) || |
| 207 | (cmHasLiteralPrefix(targetName, "Continuous") && |
| 208 | (targetName != "Continuous")) || |
| 209 | (cmHasLiteralPrefix(targetName, "Experimental") && |
| 210 | (targetName != "Experimental"))) { |
| 211 | break; |
| 212 | } |
| 213 | |
| 214 | this->AppendTarget(fout, targetName, lg, nullptr, make.c_str(), |
| 215 | makefile, compiler.c_str(), sourceFileFlags, |
| 216 | false); |
| 217 | break; |
| 218 | case cmStateEnums::EXECUTABLE: |
| 219 | case cmStateEnums::STATIC_LIBRARY: |
| 220 | case cmStateEnums::SHARED_LIBRARY: |
| 221 | case cmStateEnums::MODULE_LIBRARY: |
| 222 | case cmStateEnums::OBJECT_LIBRARY: { |
| 223 | this->AppendTarget(fout, targetName, lg, target.get(), make.c_str(), |
| 224 | makefile, compiler.c_str(), sourceFileFlags, |
| 225 | false); |
| 226 | std::string fastTarget = cmStrCat(targetName, "/fast"); |
| 227 | this->AppendTarget(fout, fastTarget, lg, target.get(), make.c_str(), |
| 228 | makefile, compiler.c_str(), sourceFileFlags, |
| 229 | false); |
no test coverage detected