fix fetching vcpkg

toml-checker
MoAlyousef 4 years ago
parent f565ad2af0
commit a32caca8f0

@ -525,14 +525,14 @@ int generate_cmake(const char *path, bool root) {
if (!cmake.vcpkg.packages.empty()) { if (!cmake.vcpkg.packages.empty()) {
cmd("include")("FetchContent"); cmd("include")("FetchContent");
cmd("message")("STATUS", "Fetching vcpkg..."); cmd("message")("STATUS", "Fetching vcpkg...");
cmd("FetchContent_Declare")("vcpkg", "https://github.com/microsoft/vcpkg/archive/refs/tags/2021.05.12.tar.gz"); cmd("FetchContent_Declare")("vcpkg", "URL", "https://github.com/microsoft/vcpkg/archive/refs/tags/2021.05.12.tar.gz");
cmd("FetchContent_MakeAvailable")("vcpkg"); cmd("FetchContent_MakeAvailable")("vcpkg");
cmd("include")("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake"); cmd("include")("${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake");
using namespace nlohmann; using namespace nlohmann;
json j; json j;
j["$schema"] = "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json"; j["$schema"] = "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json";
j["name"] = cmake.project_name; j["name"] = cmake.project_name;
if (!cmake.project_version.empty()) if (cmake.project_version.empty())
throw std::runtime_error("vcpkg manifest mode requires that the project have a version string"); throw std::runtime_error("vcpkg manifest mode requires that the project have a version string");
j["version"] = cmake.project_version; j["version"] = cmake.project_version;
j["dependencies"] = cmake.vcpkg.packages; j["dependencies"] = cmake.vcpkg.packages;

Loading…
Cancel
Save