MCPcopy Create free account
hub / github.com/Kitware/CMake / OutputAdditionalIncludeDirectories

Method OutputAdditionalIncludeDirectories

Source/cmVisualStudioGeneratorOptions.cxx:389–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void cmVisualStudioGeneratorOptions::OutputAdditionalIncludeDirectories(
390 std::ostream& fout, int indent, std::string const& lang)
391{
392 if (this->Includes.empty()) {
393 return;
394 }
395
396 std::string tag = "AdditionalIncludeDirectories";
397 if (lang == "CUDA"_s) {
398 tag = "Include";
399 } else if (lang == "ASM_MASM"_s || lang == "ASM_NASM"_s) {
400 tag = "IncludePaths";
401 }
402
403 std::ostringstream oss;
404 char const* sep = "";
405 for (std::string include : this->Includes) {
406 // first convert all of the slashes
407 std::string::size_type pos = 0;
408 while ((pos = include.find('/', pos)) != std::string::npos) {
409 include[pos] = '\\';
410 pos++;
411 }
412
413 if (lang == "ASM_NASM"_s) {
414 include += '\\';
415 }
416
417 // Escape this include for the MSBuild.
418 if (!this->LocalGenerator->IsVFProj()) {
419 cmVS10EscapeForMSBuild(include);
420 }
421 oss << sep << include;
422 sep = ";";
423
424 if (lang == "Fortran"_s) {
425 include += "/$(ConfigurationName)";
426 oss << sep << include;
427 }
428 }
429
430 if (!this->LocalGenerator->IsVFProj()) {
431 oss << sep << "%(" << tag << ')';
432 }
433
434 this->OutputFlag(fout, indent, tag, oss.str());
435}
436
437void cmVisualStudioGeneratorOptions::OutputFlagMap(std::ostream& fout,
438 int indent)

Callers 2

WriteConfigurationMethod · 0.45
WriteGroupMethod · 0.45

Calls 6

cmVS10EscapeForMSBuildFunction · 0.85
IsVFProjMethod · 0.80
strMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
OutputFlagMethod · 0.45

Tested by

no test coverage detected