Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/cmake_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,13 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
}
}

tsl::ordered_map<std::string, std::string> vcpkg_args = {
{"URL", url},
{"SUBBUILD_DIR", "CMakeFiles/vcpkg-subbuild"},
{"SOURCE_DIR", "vcpkg"},
{"BINARY_DIR", "CMakeFiles/vcpkg-build"},
};

// CMake to bootstrap vcpkg and download the packages
// clang-format off
cmd("if")("CMKR_ROOT_PROJECT", "AND", "NOT", "CMKR_DISABLE_VCPKG");
Expand All @@ -930,7 +937,7 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
cmd("cmake_policy")("SET", "CMP0135", "NEW");
cmd("endif")();
cmd("message")("STATUS", "Fetching vcpkg (" + version_name + ")...");
cmd("FetchContent_Declare")("vcpkg", "URL", url);
cmd("FetchContent_Declare")("vcpkg", vcpkg_args);
// Not using FetchContent_MakeAvailable here in case vcpkg adds CMakeLists.txt
cmd("FetchContent_GetProperties")("vcpkg");
cmd("if")("NOT", "vcpkg_POPULATED");
Expand Down