diff options
author | Brad King <brad.king@kitware.com> | 2023-05-05 16:42:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-05-05 16:42:23 (GMT) |
commit | 5924630e6d4a383ef76412a6f560fbe852837e50 (patch) | |
tree | fbab8184157448c3251e09feee8e4ce5c0b6234e /Source/cmExportFileGenerator.cxx | |
parent | 2b5b09556c08bdbcd949e600daa3059f63da240a (diff) | |
parent | c42630ee62df80e649211e99c510cab7ac28fc0b (diff) | |
download | CMake-5924630e6d4a383ef76412a6f560fbe852837e50.zip CMake-5924630e6d4a383ef76412a6f560fbe852837e50.tar.gz CMake-5924630e6d4a383ef76412a6f560fbe852837e50.tar.bz2 |
Merge topic 'compile-only-genex'
c42630ee62 cmGeneratorExpressionNode: implement `COMPILE_ONLY` genex
0fb923c460 cmGeneratorExpressionNode: implement `COMPILE_ONLY` genex
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8411
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 2ad2b47..22276ae 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -735,6 +735,22 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression( lastPos = nameStartPos + libName.size() + 1; } + while (errorString.empty() && + (pos = input.find("$<COMPILE_ONLY:", lastPos)) != std::string::npos) { + std::string::size_type nameStartPos = pos + cmStrLen("$<COMPILE_ONLY:"); + std::string::size_type endPos = input.find('>', nameStartPos); + if (endPos == std::string::npos) { + errorString = "$<COMPILE_ONLY:...> expression incomplete"; + break; + } + std::string libName = input.substr(nameStartPos, endPos - nameStartPos); + if (cmGeneratorExpression::IsValidTargetName(libName) && + this->AddTargetNamespace(libName, target, lg)) { + input.replace(nameStartPos, endPos - nameStartPos, libName); + } + lastPos = nameStartPos + libName.size() + 1; + } + this->ReplaceInstallPrefix(input); if (!errorString.empty()) { |