diff --git a/mob.ini b/mob.ini index 53aaae5..1155879 100644 --- a/mob.ini +++ b/mob.ini @@ -155,6 +155,7 @@ install_licenses = install_pythoncore = install_translations = vs = +vcpkg = qt_install = qt_bin = qt_translations = diff --git a/src/core/conf.cpp b/src/core/conf.cpp index 31a04a3..0ae09de 100644 --- a/src/core/conf.cpp +++ b/src/core/conf.cpp @@ -509,6 +509,9 @@ namespace mob { set_path_if_empty("pf_x86", find_program_files_x86); set_path_if_empty("pf_x64", find_program_files_x64); set_path_if_empty("vs", find_vs); + set_path_if_empty("vcpkg", []() { + return this_env::get().get("VCPKG_ROOT"); + }); set_path_if_empty("qt_install", find_qt); set_path_if_empty("temp_dir", find_temp_dir); set_path_if_empty("patches", find_in_root("patches")); diff --git a/src/core/conf.h b/src/core/conf.h index 2589394..c1cbcbe 100644 --- a/src/core/conf.h +++ b/src/core/conf.h @@ -264,6 +264,7 @@ namespace mob { VALUE(install_translations); VALUE(vs); + VALUE(vcpkg); VALUE(qt_install); VALUE(qt_bin); VALUE(qt_translations); diff --git a/src/tools/cmake.cpp b/src/tools/cmake.cpp index 5ce4194..ac2fea4 100644 --- a/src/tools/cmake.cpp +++ b/src/tools/cmake.cpp @@ -172,7 +172,9 @@ namespace mob { p.arg(cmd_); } - p.env(env::vs(arch_).set("CXXFLAGS", "/wd4566")) + p.env(env::vs(arch_) + .set("CXXFLAGS", "/wd4566") + .set("VCPKG_ROOT", absolute(conf().path().vcpkg()).string())) .cwd(preset_.empty() ? build_path() : root_); execute_and_join(p);