-
Notifications
You must be signed in to change notification settings - Fork 181
Building MO2 & Plugins
ModOrganizer2 is made of multiple repositories that can be found under the ModOrganizer2 Github organization. There are various type of repository, the three most important ones being:
-
cmake_common
is a CMake-only repository that contains many useful functions used by many MO2 repositories. -
uibase
contains the ModOrganizer2 C++ API. -
modorganizer
contains the main code for ModOrganizer2.
Other repositories include either libraries used by MO2, MO2 plugins (games, installers, etc.) or small executable files that are shipped with MO2 (custom LOOT CLI, nxmhandler, etc.).
In order to build most of MO2 components you will need CMake, Visual Studio and Qt. See below for the exact list of components:
-
cmake
- All MO2 components are CMake based. -
Visual Studio
with the following components:-
Desktop development with C++
- Windows Universal C Runtime
- C++ ATL for latest v143 build Tools (x86 & x64)
- C++ /CLI support for v143 build Tools (Latest) (for OMOD and FOMOD installers)
- Windows 11 SDK (get latest)
- C++ Build Tools core features
-
[optional] For repositories using C++/CLI
- Desktop .NET desktop development (for repositories using C++/CLI).
- .Net Framework 4.8 SDK
- .Net Framework 4.7.2 targeting pack (OMOD targets 4.8 but VS still requires the package for other .Net components)
-
-
- Check
mob.ini
for the appropriate version. - Depending on which components you want to build, you may need the following components:
- Qt WebEngine (display nexus pages)
- Qt Image Formats (display images in image tab and preview)
- Qt Positioning (required by QtWebEngine)
- Qt Serial Port (required by Qt Core)
- Qt WebChannel (required by QtWebEngine)
- Qt WebSockets (Nexus api/download)
- Check
MO2 components can be build in standalone mode, i.e., without having to build their dependencies first. In order to do so, MO2 relies on VCPKG with its own registry.
You can use the standalone mode to build MO2 official plugins, your own plugin or the main MO2 code.
In the example below, PATH_TO_YOUR_MO2_INSTALL
should point to your own MO2 installation.
vs2022-windows-standalone
preset uses the standalone
features defined for VCPKG.
This will install dependencies from MO2 VCPKG registry using the baseline defined in vcpkg.json
or vcpkg-configuration.json
.
You need to make sure that the baseline matches your MO2 version, and if not, you should update it.
# choose the folder where you want the code to be
mkdir C:\dev\mo2
cd C:\dev\mo2
# clone the repository you want to build
git clone git@github.com:ModOrganizer2/modorganizer.git .
# use the standalone preset
cmake --preset vs2022-windows-standalone "-DCMAKE_PREFIX_PATH=C:\Qt\6.7.3\msvc2022_64" "-DCMAKE_INSTALL_PREFIX=${PATH_TO_YOUR_MO2_INSTALL}"
# build and install
cmake --build --preset vs2022-windows-standalone --config RelWithDebInfo --parallel 16 --target INSTALL
See mob
for details.