diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-01 20:50:42 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-01 21:29:37 (GMT) |
commit | 2ec1156b80485fedba5b6d9b0802c21e1cbc2d8f (patch) | |
tree | f4cd9035b6f4bf3cbbd169718711a2604eed5969 /Source/cmGeneratorExpression.cxx | |
parent | 6660926f22b940759954e74e2b4c0c3dd0ff1991 (diff) | |
download | CMake-2ec1156b80485fedba5b6d9b0802c21e1cbc2d8f.zip CMake-2ec1156b80485fedba5b6d9b0802c21e1cbc2d8f.tar.gz CMake-2ec1156b80485fedba5b6d9b0802c21e1cbc2d8f.tar.bz2 |
Refactor: Generalize cmExportInstallFileGenerator::ReplaceInstallPrefix()
Diffstat (limited to 'Source/cmGeneratorExpression.cxx')
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index b7f7d1d..de43d3e 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -385,6 +385,20 @@ bool cmGeneratorExpression::IsValidTargetName(const std::string& input) return targetNameValidator.find(input); } +void cmGeneratorExpression::ReplaceInstallPrefix( + std::string& input, const std::string& replacement) +{ + std::string::size_type pos = 0; + std::string::size_type lastPos = pos; + + while ((pos = input.find("$<INSTALL_PREFIX>", lastPos)) != + std::string::npos) { + std::string::size_type endPos = pos + sizeof("$<INSTALL_PREFIX>") - 1; + input.replace(pos, endPos - pos, replacement); + lastPos = endPos; + } +} + void cmCompiledGeneratorExpression::GetMaxLanguageStandard( const cmGeneratorTarget* tgt, std::map<std::string, std::string>& mapping) { |