MCPcopy Create free account
hub / github.com/build-cpp/cmkr / expand_cmake_paths

Function expand_cmake_paths

src/cmake_generator.cpp:128–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128static std::vector<std::string> expand_cmake_paths(const std::vector<std::string> &sources, const fs::path &toml_dir, bool is_root_project) {
129 std::vector<std::string> paths;
130 for (const auto &src : sources) {
131 auto expanded = expand_cmake_path(src, toml_dir, is_root_project);
132 for (const auto &f : expanded) {
133 paths.push_back(f.string());
134 }
135 }
136
137 // Normalize all paths to work with CMake (it needs a / on Windows as well)
138 for (auto &path : paths) {
139 std::replace(path.begin(), path.end(), '\\', '/');
140 }
141
142 // Sort paths alphabetically for consistent cross-OS generation
143 std::sort(paths.begin(), paths.end());
144
145 // TODO: remove duplicates
146
147 return paths;
148}
149
150static void create_file(const fs::path &path, const std::string &contents) {
151 if (!path.parent_path().empty()) {

Callers 1

generate_cmakeFunction · 0.85

Calls 1

expand_cmake_pathFunction · 0.85

Tested by

no test coverage detected