diff options
author | Brad King <brad.king@kitware.com> | 2023-05-22 16:39:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-05-22 16:39:27 (GMT) |
commit | fc29c5f1bf11d018278a08ae35e2672955f9871b (patch) | |
tree | 0eb0a180f39d03da8e12626091a4a9b46083511f /Source/cmake.cxx | |
parent | 8ce4e76dbf068779c2664c28142eead093f29edf (diff) | |
parent | 8c066045ec02cdfc7396a20b842838ae87610512 (diff) | |
download | CMake-fc29c5f1bf11d018278a08ae35e2672955f9871b.zip CMake-fc29c5f1bf11d018278a08ae35e2672955f9871b.tar.gz CMake-fc29c5f1bf11d018278a08ae35e2672955f9871b.tar.bz2 |
Merge topic 'minor-refactoring'
8c066045ec Source: Improve some code readability and efficiency
f64a774b49 Source: Reuse some existing variable declarations
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8492
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0fd7461..7b13552 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2138,12 +2138,10 @@ int cmake::DoPreConfigureChecks() std::string cacheStart = cmStrCat(*this->State->GetInitializedCacheValue("CMAKE_HOME_DIRECTORY"), "/CMakeLists.txt"); - std::string currentStart = - cmStrCat(this->GetHomeDirectory(), "/CMakeLists.txt"); - if (!cmSystemTools::SameFile(cacheStart, currentStart)) { + if (!cmSystemTools::SameFile(cacheStart, srcList)) { std::string message = - cmStrCat("The source \"", currentStart, - "\" does not match the source \"", cacheStart, + cmStrCat("The source \"", srcList, "\" does not match the source \"", + cacheStart, "\" used to generate cache. Re-run cmake with a different " "source directory."); cmSystemTools::Error(message); @@ -2380,7 +2378,7 @@ int cmake::ActualConfigure() return -2; } } - if (!this->State->GetInitializedCacheValue("CMAKE_GENERATOR")) { + if (!genName) { this->AddCacheEntry("CMAKE_GENERATOR", this->GlobalGenerator->GetName(), "Name of generator.", cmStateEnums::INTERNAL); this->AddCacheEntry( |