diff options
author | Brad King <brad.king@kitware.com> | 2024-05-01 13:29:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-05-01 13:29:57 (GMT) |
commit | be111897b33be2f11c99cb18fee521dd99a3e7f3 (patch) | |
tree | 7a1f13f68d0293f700bcf4c3260a03817e8748d7 /Source/cmGeneratorTarget.cxx | |
parent | e6d04030d1796b83f5041c44cb210c9d625a23d4 (diff) | |
parent | 142a85f9c17ae8266168eb8eb2e1c9dfb76f876e (diff) | |
download | CMake-be111897b33be2f11c99cb18fee521dd99a3e7f3.zip CMake-be111897b33be2f11c99cb18fee521dd99a3e7f3.tar.gz CMake-be111897b33be2f11c99cb18fee521dd99a3e7f3.tar.bz2 |
Merge topic 'export-name-safe-name'
142a85f9c1 cxxmodules: use filesystem-safe export names in filenames
4452d41488 cmGeneratorTarget: add method to get a filesystem-safe export name
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9474
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8fe7032..319526a 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -369,6 +369,16 @@ std::string cmGeneratorTarget::GetExportName() const return this->GetName(); } +std::string cmGeneratorTarget::GetFilesystemExportName() const +{ + auto fs_safe = this->GetExportName(); + // First escape any `_` characters to avoid collisions. + cmSystemTools::ReplaceString(fs_safe, "_", "__"); + // Escape other characters that are not generally filesystem-safe. + cmSystemTools::ReplaceString(fs_safe, ":", "_c"); + return fs_safe; +} + cmValue cmGeneratorTarget::GetProperty(const std::string& prop) const { if (cmValue result = |