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

Function FindCMakeResourcesInInstallTree

Source/cmSystemTools.cxx:3089–3112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3087}
3088
3089bool FindCMakeResourcesInInstallTree(std::string const& exe_dir)
3090{
3091 // Install tree has
3092 // - "<prefix><CMAKE_BIN_DIR>/cmake"
3093 // - "<prefix><CMAKE_DATA_DIR>"
3094 // - "<prefix><CMAKE_DOC_DIR>"
3095 if (cmHasLiteralSuffix(exe_dir, CMAKE_BIN_DIR)) {
3096 std::string const prefix =
3097 exe_dir.substr(0, exe_dir.size() - cmStrLen(CMAKE_BIN_DIR));
3098 // Set cmSystemToolsCMakeRoot set to the location expected in an
3099 // install tree, even if it does not exist, so that
3100 // cmake::AddCMakePaths can print the location in its error message.
3101 cmSystemToolsCMakeRoot = cmStrCat(prefix, CMAKE_DATA_DIR);
3102 if (cmSystemTools::FileExists(
3103 cmStrCat(cmSystemToolsCMakeRoot, "/Modules/CMake.cmake"))) {
3104 if (cmSystemTools::FileExists(
3105 cmStrCat(prefix, CMAKE_DOC_DIR "/html/index.html"))) {
3106 cmSystemToolsHTMLDoc = cmStrCat(prefix, CMAKE_DOC_DIR "/html");
3107 }
3108 return true;
3109 }
3110 }
3111 return false;
3112}
3113
3114void FindCMakeResourcesInBuildTree(std::string const& exe_dir)
3115{

Callers 1

FindCMakeResourcesMethod · 0.85

Calls 6

cmHasLiteralSuffixFunction · 0.85
cmStrLenFunction · 0.70
cmStrCatFunction · 0.70
FileExistsFunction · 0.50
substrMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…