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

Method GetIncludeDirectories

Source/cmGeneratorTarget_IncludeDirectories.cxx:214–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
215 std::string const& config, std::string const& lang) const
216{
217 ConfigAndLanguage cacheKey(config, lang);
218 {
219 auto it = this->IncludeDirectoriesCache.find(cacheKey);
220 if (it != this->IncludeDirectoriesCache.end()) {
221 return it->second;
222 }
223 }
224 std::vector<BT<std::string>> includes;
225 std::unordered_set<std::string> uniqueIncludes;
226
227 cm::GenEx::Context context(this->LocalGenerator, config, lang);
228
229 cmGeneratorExpressionDAGChecker dagChecker{
230 this, "INCLUDE_DIRECTORIES", nullptr, nullptr, context,
231 };
232
233 cmList debugProperties{ this->Makefile->GetDefinition(
234 "CMAKE_DEBUG_TARGET_PROPERTIES") };
235 bool debugIncludes = !this->DebugIncludesDone &&
236 cm::contains(debugProperties, "INCLUDE_DIRECTORIES");
237
238 this->DebugIncludesDone = true;
239
240 EvaluatedTargetPropertyEntries entries = EvaluateTargetPropertyEntries(
241 this, context, &dagChecker, this->IncludeDirectoriesEntries);
242
243 if (lang == "Swift") {
244 AddLangSpecificImplicitIncludeDirectories(
245 this, lang, config, "Swift_MODULE_DIRECTORY",
246 IncludeDirectoryFallBack::BINARY, entries);
247 }
248
249 if (this->CanCompileSources() && (lang != "Swift" && lang != "Fortran")) {
250
251 std::string const propertyName = "ISPC_HEADER_DIRECTORY";
252
253 // If this target has ISPC sources make sure to add the header
254 // directory to other compilation units
255 if (cm::contains(this->GetAllConfigCompileLanguages(), "ISPC")) {
256 if (cmValue val = this->GetProperty(propertyName)) {
257 includes.emplace_back(*val);
258 } else {
259 includes.emplace_back(this->GetObjectDirectory(config));
260 }
261 }
262
263 AddLangSpecificImplicitIncludeDirectories(
264 this, "ISPC", config, propertyName, IncludeDirectoryFallBack::OBJECT,
265 entries);
266 }
267
268 AddInterfaceEntries(this, "INTERFACE_INCLUDE_DIRECTORIES", context,
269 &dagChecker, entries, IncludeRuntimeInterface::Yes);
270
271 processIncludeDirectories(this, entries, includes, uniqueIncludes,

Callers

nothing calls this directly

Calls 15

CanCompileSourcesMethod · 0.95
GetPropertyMethod · 0.95
GetObjectDirectoryMethod · 0.95
IsAppleMethod · 0.95
GetGlobalGeneratorMethod · 0.95
AddInterfaceEntriesFunction · 0.85

Tested by

no test coverage detected