summaryrefslogtreecommitdiffstats
path: root/Source/cmFileAPICodemodel.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-09-03 13:21:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-09-03 13:21:47 (GMT)
commit917cfecf12b77294370cf96150becbb4c0a9db1c (patch)
treec693715ca260dc81cd2184cbb06bef38bdbde906 /Source/cmFileAPICodemodel.cxx
parentcfae4c657fb0fff18cffd294fc5516cddfc174d1 (diff)
parent9da1c33cf1613d2b5b8192c2cffefa87466b002f (diff)
downloadCMake-917cfecf12b77294370cf96150becbb4c0a9db1c.zip
CMake-917cfecf12b77294370cf96150becbb4c0a9db1c.tar.gz
CMake-917cfecf12b77294370cf96150becbb4c0a9db1c.tar.bz2
Merge topic 'fileapi-CMP0037-OLD'
9da1c33cf1 fileapi: Fix codemodel v2 target file name for CMP0037 OLD behavior Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3760
Diffstat (limited to 'Source/cmFileAPICodemodel.cxx')
-rw-r--r--Source/cmFileAPICodemodel.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
index 08db7c7..eff32ea 100644
--- a/Source/cmFileAPICodemodel.cxx
+++ b/Source/cmFileAPICodemodel.cxx
@@ -582,6 +582,12 @@ Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt,
{
Target t(gt, this->Config);
std::string prefix = "target-" + gt->GetName();
+ for (char& c : prefix) {
+ // CMP0037 OLD behavior allows slashes in target names. Remove them.
+ if (c == '/' || c == '\\') {
+ c = '_';
+ }
+ }
if (!this->Config.empty()) {
prefix += "-" + this->Config;
}