| 228 | } |
| 229 | |
| 230 | cm::optional<std::string> GetPath(cmMakefile& mf, char const* cachevar, |
| 231 | char const* envvar, char const* desc) |
| 232 | { |
| 233 | cm::optional<std::string> result; |
| 234 | |
| 235 | auto def = mf.GetDefinition(cachevar); |
| 236 | if (def) { |
| 237 | result = *def; |
| 238 | return result; |
| 239 | } |
| 240 | |
| 241 | std::string path; |
| 242 | if (cmSystemTools::GetEnv(envvar, path)) { |
| 243 | mf.AddCacheDefinition(cachevar, path, desc, cmStateEnums::FILEPATH); |
| 244 | result = std::move(path); |
| 245 | return result; |
| 246 | } |
| 247 | |
| 248 | return result; |
| 249 | } |
| 250 | |
| 251 | cm::optional<std::string> GetSysrootDir(cmMakefile& mf) |
| 252 | { |
searching dependent graphs…