mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 07:08:38 -05:00
Merge topic 'fix-include_directories-whitespace-handling'
2f84dfe include_directories: Fix handling of empty or space-only entries
This commit is contained in:
@@ -116,13 +116,19 @@ void cmIncludeDirectoryCommand::GetIncludes(const std::string &arg,
|
||||
{
|
||||
std::string inc = arg.substr(lastPos,pos);
|
||||
this->NormalizeInclude(inc);
|
||||
incs.push_back(inc);
|
||||
if (!inc.empty())
|
||||
{
|
||||
incs.push_back(inc);
|
||||
}
|
||||
}
|
||||
lastPos = pos + 1;
|
||||
}
|
||||
std::string inc = arg.substr(lastPos);
|
||||
this->NormalizeInclude(inc);
|
||||
incs.push_back(inc);
|
||||
if (!inc.empty())
|
||||
{
|
||||
incs.push_back(inc);
|
||||
}
|
||||
}
|
||||
|
||||
void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc)
|
||||
@@ -133,6 +139,11 @@ void cmIncludeDirectoryCommand::NormalizeInclude(std::string &inc)
|
||||
{
|
||||
inc.assign(inc, b, 1+e-b); // copy the remaining substring
|
||||
}
|
||||
else
|
||||
{
|
||||
inc = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cmSystemTools::IsOff(inc.c_str()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user