| 2172 | } |
| 2173 | |
| 2174 | void cmake::SetHomeDirectory(std::string const& dir) |
| 2175 | { |
| 2176 | assert(!dir.empty()); |
| 2177 | this->State->SetSourceDirectory(dir); |
| 2178 | if (this->CurrentSnapshot.IsValid()) { |
| 2179 | this->CurrentSnapshot.SetDefinition("CMAKE_SOURCE_DIR", dir); |
| 2180 | } |
| 2181 | |
| 2182 | if (this->State->GetIsTryCompile() == cmState::TryCompile::No) { |
| 2183 | this->Messenger->SetTopSource(this->GetHomeDirectory()); |
| 2184 | } else { |
| 2185 | this->Messenger->SetTopSource(cm::nullopt); |
| 2186 | } |
| 2187 | } |
| 2188 | |
| 2189 | std::string const& cmake::GetHomeDirectory() const |
| 2190 | { |
no test coverage detected