diff options
author | Brad King <brad.king@kitware.com> | 2013-03-19 19:20:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-03-19 19:20:27 (GMT) |
commit | 16695a6d77e48532102f09289cf5a9fad5184df7 (patch) | |
tree | 10bc73d412096fcd758da21ae507cad1b0daf87c /Source | |
parent | cc1c5331639df99b236283b1c2ffc05be5ad6291 (diff) | |
parent | 7a619fa6fbebdd907815be2d0edaef0184a3ad95 (diff) | |
download | CMake-16695a6d77e48532102f09289cf5a9fad5184df7.zip CMake-16695a6d77e48532102f09289cf5a9fad5184df7.tar.gz CMake-16695a6d77e48532102f09289cf5a9fad5184df7.tar.bz2 |
Merge topic 'fix-genex-preprocess'
7a619fa Fix cmGeneratorExpression::Preprocess for interleaved inputs.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 3f59129..ab8bd13 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -236,9 +236,29 @@ static std::string stripExportInterface(const std::string &input, std::string::size_type pos = 0; std::string::size_type lastPos = pos; - while((pos = input.find("$<BUILD_INTERFACE:", lastPos)) != input.npos - || (pos = input.find("$<INSTALL_INTERFACE:", lastPos)) != input.npos) + while (true) { + std::string::size_type bPos = input.find("$<BUILD_INTERFACE:", lastPos); + std::string::size_type iPos = input.find("$<INSTALL_INTERFACE:", lastPos); + + if (bPos == std::string::npos && iPos == std::string::npos) + { + break; + } + + if (bPos == std::string::npos) + { + pos = iPos; + } + else if (iPos == std::string::npos) + { + pos = bPos; + } + else + { + pos = (bPos < iPos) ? bPos : iPos; + } + result += input.substr(lastPos, pos - lastPos); const bool gotInstallInterface = input[pos + 2] == 'I'; pos += gotInstallInterface ? sizeof("$<INSTALL_INTERFACE:") - 1 |