diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2019-01-31 15:58:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-31 17:49:56 (GMT) |
commit | 1c6c2bae285ecce518d68f708729840df9c28fb0 (patch) | |
tree | b45b0c921ce42da509ad1679f6d1f310d43a6258 /Source/cmServerProtocol.cxx | |
parent | d526327079e23748dd2a87acd4d9b4b1174725bf (diff) | |
download | CMake-1c6c2bae285ecce518d68f708729840df9c28fb0.zip CMake-1c6c2bae285ecce518d68f708729840df9c28fb0.tar.gz CMake-1c6c2bae285ecce518d68f708729840df9c28fb0.tar.bz2 |
cmake-server: Normalize build and source directories
Fixes: #18862
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r-- | Source/cmServerProtocol.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index c3c8156..203ee93 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -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 + |