| 892 | } |
| 893 | |
| 894 | cm::VS::Solution::Folder* cmGlobalVisualStudioGenerator::CreateSolutionFolder( |
| 895 | cm::VS::Solution& solution, cm::string_view rawName) const |
| 896 | { |
| 897 | cm::VS::Solution::Folder* folder = nullptr; |
| 898 | std::string canonicalName; |
| 899 | for (std::string::size_type cur = 0;;) { |
| 900 | static std::string delims = "/\\"; |
| 901 | cur = rawName.find_first_not_of(delims, cur); |
| 902 | if (cur == std::string::npos) { |
| 903 | break; |
| 904 | } |
| 905 | std::string::size_type end = rawName.find_first_of(delims, cur); |
| 906 | cm::string_view f = end == std::string::npos |
| 907 | ? rawName.substr(cur) |
| 908 | : rawName.substr(cur, end - cur); |
| 909 | canonicalName = |
| 910 | canonicalName.empty() ? std::string(f) : cmStrCat(canonicalName, '/', f); |
| 911 | cm::VS::Solution::Folder* nextFolder = solution.GetFolder(canonicalName); |
| 912 | if (nextFolder->Id.empty()) { |
| 913 | nextFolder->Id = |
| 914 | this->GetGUID(cmStrCat("CMAKE_FOLDER_GUID_"_s, canonicalName)); |
| 915 | if (folder) { |
| 916 | folder->Folders.emplace_back(nextFolder); |
| 917 | } |
| 918 | solution.Folders.emplace_back(nextFolder); |
| 919 | } |
| 920 | folder = nextFolder; |
| 921 | cur = end; |
| 922 | } |
| 923 | return folder; |
| 924 | } |
| 925 | |
| 926 | cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution( |
| 927 | cmLocalGenerator const* root, TargetDependSet const& projectTargets) const |
no test coverage detected