|
@@ -269,6 +269,10 @@ static bool testHomeDirectory(cmState* state, std::string& value,
|
|
|
{
|
|
{
|
|
|
const std::string cachedValue =
|
|
const std::string cachedValue =
|
|
|
std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"));
|
|
std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"));
|
|
|
|
|
+ if (value.empty()) {
|
|
|
|
|
+ value = cachedValue;
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
const std::string suffix = "/CMakeLists.txt";
|
|
const std::string suffix = "/CMakeLists.txt";
|
|
|
const std::string cachedValueCML = cachedValue + suffix;
|
|
const std::string cachedValueCML = cachedValue + suffix;
|
|
|
const std::string valueCML = value + suffix;
|
|
const std::string valueCML = value + suffix;
|
|
@@ -279,9 +283,6 @@ static bool testHomeDirectory(cmState* state, std::string& value,
|
|
|
"source directory value."));
|
|
"source directory value."));
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (value.empty()) {
|
|
|
|
|
- value = cachedValue;
|
|
|
|
|
- }
|
|
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -292,15 +293,15 @@ static bool testValue(cmState* state, const std::string& key,
|
|
|
const char* entry = state->GetCacheEntryValue(key);
|
|
const char* entry = state->GetCacheEntryValue(key);
|
|
|
const std::string cachedValue =
|
|
const std::string cachedValue =
|
|
|
entry == nullptr ? std::string() : std::string(entry);
|
|
entry == nullptr ? std::string() : std::string(entry);
|
|
|
- if (!cachedValue.empty() && !value.empty() && cachedValue != value) {
|
|
|
|
|
|
|
+ if (value.empty()) {
|
|
|
|
|
+ value = cachedValue;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!cachedValue.empty() && cachedValue != value) {
|
|
|
setErrorMessage(errorMessage, std::string("\"") + key +
|
|
setErrorMessage(errorMessage, std::string("\"") + key +
|
|
|
"\" is set but incompatible with configured " +
|
|
"\" is set but incompatible with configured " +
|
|
|
keyDescription + " value.");
|
|
keyDescription + " value.");
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- if (value.empty()) {
|
|
|
|
|
- value = cachedValue;
|
|
|
|
|
- }
|
|
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|