Commit 1c6c2bae authored by Gregor Jasny's avatar Gregor Jasny Committed by Brad King

cmake-server: Normalize build and source directories

Fixes: #18862
parent d5263270
......@@ -222,13 +222,22 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
std::string* errorMessage)
{
std::string sourceDirectory = request.Data[kSOURCE_DIRECTORY_KEY].asString();
const std::string buildDirectory =
request.Data[kBUILD_DIRECTORY_KEY].asString();
std::string buildDirectory = request.Data[kBUILD_DIRECTORY_KEY].asString();
std::string generator = request.Data[kGENERATOR_KEY].asString();
std::string extraGenerator = request.Data[kEXTRA_GENERATOR_KEY].asString();
std::string toolset = request.Data[kTOOLSET_KEY].asString();
std::string platform = request.Data[kPLATFORM_KEY].asString();
// normalize source and build directory
if (!sourceDirectory.empty()) {
sourceDirectory = cmSystemTools::CollapseFullPath(sourceDirectory);
cmSystemTools::ConvertToUnixSlashes(sourceDirectory);
}
if (!buildDirectory.empty()) {
buildDirectory = cmSystemTools::CollapseFullPath(buildDirectory);
cmSystemTools::ConvertToUnixSlashes(buildDirectory);
}
if (buildDirectory.empty()) {
setErrorMessage(errorMessage,
std::string("\"") + kBUILD_DIRECTORY_KEY +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment