Skip to content
Snippets Groups Projects
Commit e0c3b926 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'windows-long-path'


2fe39dc3 cmake: Fix loading CMake sources from long paths on Windows

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5940
parents 03f2aad7 2fe39dc3
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,10 @@
#include <sstream>
#include <utility>
#ifdef _WIN32
# include <cmsys/Encoding.hxx>
#endif
#include "cmListFileLexer.h"
#include "cmMessageType.h"
#include "cmMessenger.h"
......@@ -83,9 +87,15 @@ bool cmListFileParser::ParseFile(const char* filename)
{
this->FileName = filename;
#ifdef _WIN32
std::string expandedFileName = cmsys::Encoding::ToNarrow(
cmSystemTools::ConvertToWindowsExtendedPath(filename));
filename = expandedFileName.c_str();
#endif
// Open the file.
cmListFileLexer_BOM bom;
if (!cmListFileLexer_SetFileName(this->Lexer, this->FileName, &bom)) {
if (!cmListFileLexer_SetFileName(this->Lexer, filename, &bom)) {
this->IssueFileOpenError("cmListFileCache: error can not open file.");
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment