This PR contains the change for mob to use VCPKG instead of custom stuff to build third-party dependencies. The only things that should be build by mob after this are:
USVFS
Everything that was under modorganizer_super except cmake_common
TBD the third-party stylesheets
Aside from removing the tasks for third-party dependencies, the main changes for mob is the use of the CMake presets from the various MO2 repository and the use of cmake itself to build install (prior to this mob would call msbuild).
VCPKG
Most dependencies are fetch from the official VCPKG registry, but some are built from MO2 registry.
The dependencies that are prefixed with mo2- are specific to MO2:
mo2-dds-header - this is a very small port that make the DDS.h header from DirectXTex available. This header is private and not part of DirectXTex official port, maybe there is a reason for that...
mo2-bsatk, mo2-esptk - these are ports to build bsatk/esptk when building in standalone mode (see below), these are not prebuilt
mo2-cmake - this is the port for cmake_common, all MO2 repositories (except USVFS) depend on this, even when building with mob
mo2-libbsarch - this is the port for libbsarch, using prebuilt libbsarch, and used when building MO2 (including build with mob)
mo2-uibase - this is a port for uibase that is used when building in standalone mode (see below)
The other dependencies are either not part of MO2 directly but either not available on the official registry (e.g. libloot) or require slight changes.
libloot - this is a port for libloot using prebuilt (same as before), building libloot requires way too many dependencies to build it within the port
asmjit - adaptation of the official port to use an old commit instead of the current one
pybind11 - official port without the Python dependency
spdlog - official port customized to remove the fmt dependency (force std::format)
7zip - custom port that uses the official CMakeLists.txt but forces dynamic linking (see below)
Most of MO2 dependencies are statically linked, so the VCPKG triplet used is x64-windows-static-md. I was not able to adapt MO2 code (or even a very small example) to work with a statically built 7zip. One could use a custom triplet to build 7zip in dynamic mode and everything else statically, but using a custom triplet prevents VCPKG from sharing the build between components that have different triplets. Since the main repository needs 7zip (for archive) and has many Boost dependencies, it means re-compiling most of Boost because of this. I found it much simpler to use a custom port and force 7zip to dynamic mode.
cmake_common
The cmake_common utilities are now available as a VCPKG port called mo2-cmake. I made a lot of refactoring to remove not very useful stuff and allow more flexibility when using the available functions:
removed most of mo2_configure_xxx stuff to keep only mo2_configure_target and mo2_configure_plugin, the other functions (uibase, executable, library, etc.) where not very useful,
removed mo2_install_target for mo2_install_plugin
does the same as before for plugins (install plugin itself + pdb)
for library-like targets, this is done directly by the CMake install(TARGETS ...) stuff (.lib, .dll, etc.)
for executable, this is done by adding CMake instalL(FILES) use generator expression $<TARGET_FILE:xxx> and $<TARGET_FILE_PDB:xxx>.
split cmake_configure_target into multiple functions so you can either use cmake_configure_target or the independent functions for more control, also added options to cmake_configure_target
in particular, it is possible to use cmake_configure_target without having the sources added automatically, to allow more control and avoid automatic use of GLOB_RECURSE + CONFIGURE_DEPENDS
updated the Python stuff for external Python + added way to automatically get access to PyQt when required
To-Do List
[X] Use CMake preset when available (presence of CMakePresets.json).
[X] Combine Bethesda game plugins into a single one.
[X] Remove stuff not useful anymore:
[X] Gamebryo related stuff.
[X] Nuget stuff (not required anymore).
[ ] Move mob dependencies to VCPKG itself.
[ ] Remove all third-party tasks - TBD what to do exactly.
[ ] Choose what to do with the explorerpp task.
[ ] Choose what to do with the licenses task.
[ ] Choose what to do with the stylesheets task.
[ ] Fix translations task.
[ ] Check/fix that dev builds and releases generation work properly.
PR Content
This PR contains the change for
mob
to use VCPKG instead of custom stuff to build third-party dependencies. The only things that should be build bymob
after this are:modorganizer_super
exceptcmake_common
Aside from removing the tasks for third-party dependencies, the main changes for
mob
is the use of the CMake presets from the various MO2 repository and the use ofcmake
itself to build install (prior to thismob
would callmsbuild
).VCPKG
Most dependencies are fetch from the official VCPKG registry, but some are built from MO2 registry.
The dependencies that are prefixed with
mo2-
are specific to MO2:mo2-dds-header
- this is a very small port that make theDDS.h
header from DirectXTex available. This header is private and not part ofDirectXTex
official port, maybe there is a reason for that...mo2-bsatk
,mo2-esptk
- these are ports to build bsatk/esptk when building in standalone mode (see below), these are not prebuiltmo2-cmake
- this is the port forcmake_common
, all MO2 repositories (except USVFS) depend on this, even when building withmob
mo2-libbsarch
- this is the port forlibbsarch
, using prebuilt libbsarch, and used when building MO2 (including build withmob
)mo2-uibase
- this is a port foruibase
that is used when building in standalone mode (see below)The other dependencies are either not part of MO2 directly but either not available on the official registry (e.g.
libloot
) or require slight changes.libloot
- this is a port forlibloot
using prebuilt (same as before), buildinglibloot
requires way too many dependencies to build it within the portasmjit
- adaptation of the official port to use an old commit instead of the current onepybind11
- official port without the Python dependencyspdlog
- official port customized to remove thefmt
dependency (forcestd::format
)7zip
- custom port that uses the officialCMakeLists.txt
but forces dynamic linking (see below)x64-windows-static-md
. I was not able to adapt MO2 code (or even a very small example) to work with a statically built 7zip. One could use a custom triplet to build7zip
in dynamic mode and everything else statically, but using a custom triplet prevents VCPKG from sharing the build between components that have different triplets. Since the main repository needs7zip
(forarchive
) and has many Boost dependencies, it means re-compiling most of Boost because of this. I found it much simpler to use a custom port and force 7zip to dynamic mode.cmake_common
The
cmake_common
utilities are now available as a VCPKG port calledmo2-cmake
. I made a lot of refactoring to remove not very useful stuff and allow more flexibility when using the available functions:mo2_configure_xxx
stuff to keep onlymo2_configure_target
andmo2_configure_plugin
, the other functions (uibase, executable, library, etc.) where not very useful,mo2_install_target
formo2_install_plugin
install(TARGETS ...)
stuff (.lib
,.dll
, etc.)instalL(FILES
) use generator expression$<TARGET_FILE:xxx>
and$<TARGET_FILE_PDB:xxx>
.cmake_configure_target
into multiple functions so you can either usecmake_configure_target
or the independent functions for more control, also added options tocmake_configure_target
cmake_configure_target
without having the sources added automatically, to allow more control and avoid automatic use ofGLOB_RECURSE
+CONFIGURE_DEPENDS
PyQt
when requiredTo-Do List
CMakePresets.json
).mob
dependencies to VCPKG itself.