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

Function do_open

Source/cmakemain.cxx:1058–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056}
1057
1058int do_open(int ac, char const* const* av)
1059{
1060#ifdef CMAKE_BOOTSTRAP
1061 std::cerr << "This cmake does not support --open\n";
1062 return -1;
1063#else
1064 std::string dir;
1065
1066 enum Doing
1067 {
1068 DoingNone,
1069 DoingDir,
1070 };
1071 Doing doing = DoingDir;
1072 for (int i = 2; i < ac; ++i) {
1073 switch (doing) {
1074 case DoingDir:
1075 dir = cmSystemTools::ToNormalizedPathOnDisk(av[i]);
1076 doing = DoingNone;
1077 break;
1078 default:
1079 std::cerr << "Unknown argument " << av[i] << std::endl;
1080 dir.clear();
1081 break;
1082 }
1083 }
1084 if (dir.empty()) {
1085 std::cerr << "Usage: cmake --open <dir>\n";
1086 return 1;
1087 }
1088
1089 cmake cm(cmState::Role::Internal);
1090 cmSystemTools::SetMessageCallback(
1091 [&cm](std::string const& msg, cmMessageMetadata const& md) {
1092 cmakemainMessageCallback(msg, md, &cm);
1093 });
1094 cm.SetProgressCallback([&cm](std::string const& msg, float prog) {
1095 cmakemainProgressCallback(msg, prog, &cm);
1096 });
1097 return cm.Open(dir, cmake::DryRun::No) ? 0 : 1;
1098#endif
1099}
1100} // namespace
1101
1102int main(int ac, char const* const* av)

Callers 1

mainFunction · 0.85

Calls 6

cmakemainMessageCallbackFunction · 0.85
SetProgressCallbackMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45
OpenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…