Skip to content

Commit

Permalink
Use preset if possible when building super repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 8, 2024
1 parent 526ed91 commit 55f5941
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/tasks/modorganizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,18 @@ namespace mob::tasks {

cmake modorganizer::create_cmake_tool(const fs::path& root, cmake::ops o, config c)
{
return std::move(
cmake(o)
.generator(cmake::vs)
.def("CMAKE_INSTALL_PREFIX:PATH", conf().path().install())
.def("DEPENDENCIES_DIR", conf().path().build())
cmake g(o);

g.generator(cmake::vs)
.def("CMAKE_INSTALL_PREFIX:PATH", conf().path().install())
.def("CMAKE_PREFIX_PATH", conf().path().install() / "lib" / "cmake")
.root(root);

if (exists(root / "CMakePresets.json")) {
g.preset("vs2022-windows");
}
else {
g.def("DEPENDENCIES_DIR", conf().path().build())
.def("BOOST_ROOT", boost::source_path())
.def("BOOST_LIBRARYDIR", boost::lib_path(arch::x64))
.def("SPDLOG_ROOT", spdlog::source_path())
Expand All @@ -226,8 +233,10 @@ namespace mob::tasks {
gtest::build_path(arch::x64, c == config::debug ? config::debug
: config::release))
.def("OPENSSL_ROOT_DIR", openssl::source_path())
.def("DIRECTXTEX_ROOT", directxtex::source_path())
.root(root));
.def("DIRECTXTEX_ROOT", directxtex::source_path());
}

return std::move(g);
}

msbuild modorganizer::create_msbuild_tool(msbuild::ops o)
Expand Down

0 comments on commit 55f5941

Please sign in to comment.