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

Method SetGlobalGenerator

Source/cmake.cxx:2228–2266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2226}
2227
2228void cmake::SetGlobalGenerator(std::unique_ptr<cmGlobalGenerator> gg)
2229{
2230 if (!gg) {
2231 cmSystemTools::Error("Error SetGlobalGenerator called with null");
2232 return;
2233 }
2234 if (this->GlobalGenerator) {
2235 // restore the original environment variables CXX and CC
2236 std::string env = "CC=";
2237 if (!this->CCEnvironment.empty()) {
2238 env += this->CCEnvironment;
2239 cmSystemTools::PutEnv(env);
2240 } else {
2241 cmSystemTools::UnPutEnv(env);
2242 }
2243 env = "CXX=";
2244 if (!this->CXXEnvironment.empty()) {
2245 env += this->CXXEnvironment;
2246 cmSystemTools::PutEnv(env);
2247 } else {
2248 cmSystemTools::UnPutEnv(env);
2249 }
2250 }
2251
2252 // set the new
2253 this->GlobalGenerator = std::move(gg);
2254
2255 // set the global flag for unix style paths on cmSystemTools as soon as
2256 // the generator is set. This allows gmake to be used on windows.
2257 cmSystemTools::SetForceUnixPaths(this->GlobalGenerator->GetForceUnixPaths());
2258
2259 // Save the environment variables CXX and CC
2260 if (!cmSystemTools::GetEnv("CXX", this->CXXEnvironment)) {
2261 this->CXXEnvironment.clear();
2262 }
2263 if (!cmSystemTools::GetEnv("CC", this->CCEnvironment)) {
2264 this->CCEnvironment.clear();
2265 }
2266}
2267
2268int cmake::DoPreConfigureChecks()
2269{

Callers 10

FindPackageMethod · 0.95
GetSystemInformationMethod · 0.95
BuildMethod · 0.95
TryCompileMethod · 0.45
ExecuteCMakeCommandMethod · 0.45
RunMethod · 0.45
configureMethod · 0.45

Calls 5

moveFunction · 0.85
ErrorClass · 0.70
emptyMethod · 0.45
GetForceUnixPathsMethod · 0.45
clearMethod · 0.45

Tested by 1

RunMethod · 0.36