summaryrefslogtreecommitdiffstats
path: root/Source/cmIncludeDirectoryCommand.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-05-20 10:25:59 (GMT)
committerBrad King <brad.king@kitware.com>2013-05-21 19:20:46 (GMT)
commit2f84dfec93b6a5d8b4db89bafe09688382b96997 (patch)
tree8d60fce3ce64afe43535dc6bb845c13b4b136c89 /Source/cmIncludeDirectoryCommand.cxx
parent5dd8c01429da90a7417b72f17e784cc98f70f57c (diff)
downloadCMake-2f84dfec93b6a5d8b4db89bafe09688382b96997.zip
CMake-2f84dfec93b6a5d8b4db89bafe09688382b96997.tar.gz
CMake-2f84dfec93b6a5d8b4db89bafe09688382b96997.tar.bz2
include_directories: Fix handling of empty or space-only entries
This is a regression introduced in commit 0d46e9a0 (Store includes from the same include_directories call together., 2013-01-20). Reported at http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/46695/focus=7847
Diffstat (limited to 'Source/cmIncludeDirectoryCommand.cxx')
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index ffb0e80..30c1743 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -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()))
{