|
|
@ -51,7 +51,7 @@ static std::vector<std::string> expand_cmake_path(const fs::path &p) {
|
|
|
|
temp.push_back(p.string());
|
|
|
|
temp.push_back(p.string());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Normalize all paths to work with CMake (it needs a / on Windows as well)
|
|
|
|
// Normalize all paths to work with CMake (it needs a / on Windows as well)
|
|
|
|
for(auto& path : temp) {
|
|
|
|
for (auto &path : temp) {
|
|
|
|
std::replace(path.begin(), path.end(), '\\', '/');
|
|
|
|
std::replace(path.begin(), path.end(), '\\', '/');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return temp;
|
|
|
|
return temp;
|
|
|
@ -159,11 +159,13 @@ int generate_cmake(const char *path) {
|
|
|
|
ss << "\n\n";
|
|
|
|
ss << "\n\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string desc = "";
|
|
|
|
|
|
|
|
if (!cmake.desc.empty())
|
|
|
|
|
|
|
|
desc = "\n\tLANGUAGES C CXX\n\tDESCRIPTION \"" + cmake.desc + "\"";
|
|
|
|
|
|
|
|
|
|
|
|
if (!cmake.proj_name.empty() && !cmake.proj_version.empty()) {
|
|
|
|
if (!cmake.proj_name.empty() && !cmake.proj_version.empty()) {
|
|
|
|
ss << "set(" << cmake.proj_name << "_PROJECT_VERSION " << cmake.proj_version << ")\n"
|
|
|
|
ss << "project(" << cmake.proj_name << "\n\tVERSION " << cmake.proj_version << desc
|
|
|
|
<< "project(" << cmake.proj_name << " VERSION "
|
|
|
|
<< "\n\t)\n\n";
|
|
|
|
<< "${" << cmake.proj_name << "_PROJECT_VERSION}"
|
|
|
|
|
|
|
|
<< ")\n\n";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!cmake.packages.empty()) {
|
|
|
|
if (!cmake.packages.empty()) {
|
|
|
@ -206,7 +208,12 @@ int generate_cmake(const char *path) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// don't change arg
|
|
|
|
// don't change arg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ss << "\t" << first_arg << " " << arg.second << "\n";
|
|
|
|
if (first_arg != "GIT_REPOSITORY")
|
|
|
|
|
|
|
|
ss << "\t" << first_arg << " " << arg.second << "\n";
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
ss << "\t" << first_arg << " " << arg.second << "\n\t"
|
|
|
|
|
|
|
|
<< "GIT_SHALLOW "
|
|
|
|
|
|
|
|
<< "ON\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ss << "\t)\n\n"
|
|
|
|
ss << "\t)\n\n"
|
|
|
|
<< "FetchContent_MakeAvailable(" << dep.first << ")\n\n";
|
|
|
|
<< "FetchContent_MakeAvailable(" << dep.first << ")\n\n";
|
|
|
|