diff options
author | Brad King <brad.king@kitware.com> | 2013-05-21 19:22:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-05-21 19:22:27 (GMT) |
commit | 4825d70e830395ebff09a7fba73eb6ff5661048b (patch) | |
tree | 5c71bb45a6735aee0b90da984af6f47bb68742b0 /Source | |
parent | d2cd362c31aafb157970c04bf507bafcf475f89a (diff) | |
parent | 2f84dfec93b6a5d8b4db89bafe09688382b96997 (diff) | |
download | CMake-4825d70e830395ebff09a7fba73eb6ff5661048b.zip CMake-4825d70e830395ebff09a7fba73eb6ff5661048b.tar.gz CMake-4825d70e830395ebff09a7fba73eb6ff5661048b.tar.bz2 |
Merge topic 'fix-include_directories-whitespace-handling'
2f84dfe include_directories: Fix handling of empty or space-only entries
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmIncludeDirectoryCommand.cxx | 15 |
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())) { |