Skip to content

Commit a7a64bc

Browse files
committed
Move to VCPKG.
1 parent fc263f2 commit a7a64bc

15 files changed

Lines changed: 154 additions & 127 deletions

.github/workflows/build.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
1-
name: Build Installer FOMOD Plugin
1+
name: Build Installer FOMOD
22

33
on:
44
push:
55
branches: master
66
pull_request:
77
types: [opened, synchronize, reopened]
88

9+
env:
10+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
11+
912
jobs:
1013
build:
1114
runs-on: windows-2022
1215
steps:
13-
- name: Build Installer FOMOD Plugin
14-
uses: ModOrganizer2/build-with-mob-action@master
16+
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
17+
- name: Export GitHub Actions cache environment variables
18+
uses: actions/github-script@v7
19+
with:
20+
script: |
21+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
22+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
23+
24+
- name: Install Qt
25+
uses: jurplel/install-qt-action@v3
1526
with:
16-
mo2-dependencies: cmake_common uibase
27+
setup-python: false
28+
version: 6.7.0
29+
modules:
30+
cache: true
31+
32+
- uses: actions/checkout@v4
33+
34+
- name: "Set environmental variables"
35+
shell: bash
36+
run: |
37+
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
38+
39+
- name: Configure Installer FOMOD
40+
shell: pwsh
41+
run: |
42+
cmake --preset vs2022-windows-standalone `
43+
"-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64" `
44+
"-DCMAKE_INSTALL_PREFIX=install"
45+
46+
- name: Build Installer FOMOD
47+
run: cmake --build vsbuild --config RelWithDebInfo --target INSTALL

CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@ cmake_minimum_required(VERSION 3.16)
22

33
project(installer_fomod)
44

5-
if(DEFINED DEPENDENCIES_DIR)
6-
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
7-
else()
8-
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
9-
endif()
10-
115
add_subdirectory(src)

CMakePresets.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"configurePresets": [
3+
{
4+
"errors": {
5+
"deprecated": true
6+
},
7+
"hidden": true,
8+
"name": "cmake-dev",
9+
"warnings": {
10+
"deprecated": true,
11+
"dev": true
12+
}
13+
},
14+
{
15+
"cacheVariables": {
16+
"VCPKG_MANIFEST_NO_DEFAULT_FEATURES": {
17+
"type": "BOOL",
18+
"value": "ON"
19+
}
20+
},
21+
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
22+
"hidden": true,
23+
"name": "vcpkg"
24+
},
25+
{
26+
"hidden": true,
27+
"inherits": ["vcpkg"],
28+
"name": "vcpkg-dev"
29+
},
30+
{
31+
"binaryDir": "${sourceDir}/vsbuild",
32+
"architecture": {
33+
"strategy": "set",
34+
"value": "x64"
35+
},
36+
"cacheVariables": {
37+
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4",
38+
"VCPKG_TARGET_TRIPLET": {
39+
"type": "STRING",
40+
"value": "x64-windows-static-md"
41+
}
42+
},
43+
"generator": "Visual Studio 17 2022",
44+
"inherits": ["cmake-dev", "vcpkg-dev"],
45+
"name": "vs2022-windows",
46+
"toolset": "v143"
47+
},
48+
{
49+
"cacheVariables": {
50+
"VCPKG_MANIFEST_FEATURES": {
51+
"type": "STRING",
52+
"value": "standalone"
53+
}
54+
},
55+
"inherits": "vs2022-windows",
56+
"name": "vs2022-windows-standalone"
57+
}
58+
],
59+
"version": 4
60+
}

src/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
cmake_minimum_required(VERSION 3.16)
22

3+
find_package(mo2-cmake CONFIG REQUIRED)
4+
find_package(mo2-uibase CONFIG REQUIRED)
5+
36
add_library(installer_fomod SHARED)
47
mo2_configure_plugin(installer_fomod WARNINGS OFF)
5-
mo2_install_target(installer_fomod)
8+
target_link_libraries(installer_fomod PRIVATE mo2::uibase)
9+
mo2_install_plugin(installer_fomod)

src/SConscript

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/fomodinstallerdialog.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,10 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2020
#include "fomodinstallerdialog.h"
2121
#include "ui_fomodinstallerdialog.h"
2222

23-
#include "fomodscreenshotdialog.h"
24-
#include "igamefeatures.h"
25-
#include "imoinfo.h"
26-
#include "iplugingame.h"
27-
#include "log.h"
28-
#include "report.h"
29-
#include "scopeguard.h"
30-
#include "scriptextender.h"
31-
#include "utility.h"
32-
#include "xmlreader.h"
23+
#include <array>
24+
#include <sstream>
25+
#include <utility>
26+
#include <vector>
3327

3428
#include <QCheckBox>
3529
#include <QCompleter>
@@ -43,10 +37,17 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
4337

4438
#include <Shellapi.h>
4539

46-
#include <array>
47-
#include <sstream>
48-
#include <utility>
49-
#include <vector>
40+
#include <uibase/game_features/igamefeatures.h>
41+
#include <uibase/game_features/scriptextender.h>
42+
#include <uibase/imoinfo.h>
43+
#include <uibase/iplugingame.h>
44+
#include <uibase/log.h>
45+
#include <uibase/report.h>
46+
#include <uibase/scopeguard.h>
47+
#include <uibase/utility.h>
48+
49+
#include "fomodscreenshotdialog.h"
50+
#include "xmlreader.h"
5051

5152
using namespace MOBase;
5253

src/fomodinstallerdialog.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
1919

2020
#pragma once
2121

22-
#include "guessedvalue.h"
23-
#include "ifiletree.h"
24-
#include "imoinfo.h"
25-
#include "iplugininstaller.h"
26-
#include "ipluginlist.h"
27-
2822
#include <QDialog>
2923
#include <QGroupBox>
3024
#include <QMetaType>
@@ -34,6 +28,12 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
3428
#include <functional>
3529
#include <vector>
3630

31+
#include <uibase/guessedvalue.h>
32+
#include <uibase/ifiletree.h>
33+
#include <uibase/imoinfo.h>
34+
#include <uibase/iplugininstaller.h>
35+
#include <uibase/ipluginlist.h>
36+
3737
#include "installerfomod.h"
3838

3939
class QAbstractButton;

src/fomodscreenshotdialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ GNU General Public License for more details.
1616
You should have received a copy of the GNU General Public License
1717
along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
2019
#include "fomodscreenshotdialog.h"
2120
#include "ui_fomodscreenshotdialog.h"
2221

23-
#include "scalelabel.h"
24-
2522
#include <QDirIterator>
2623
#include <QFrame>
2724
#include <QProxyStyle>
@@ -30,6 +27,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
3027
#include <QTableWidget>
3128
#include <QWindow>
3229

30+
#include "scalelabel.h"
31+
3332
constexpr int kScreenshotTileWidth = 100;
3433
constexpr int kScreenshotTileHeight = 80;
3534
constexpr int kScreenshotTileSpacing = 16;

src/installerFomod.pro

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/installerfomod.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#include "installerfomod.h"
22

3-
#include "fomodinstallerdialog.h"
4-
#include "imodinterface.h"
5-
#include "imodlist.h"
6-
7-
#include <iinstallationmanager.h>
8-
#include <log.h>
9-
#include <report.h>
10-
#include <utility.h>
11-
123
#include <QImageReader>
134
#include <QStringList>
145
#include <QtPlugin>
156

7+
#include <uibase/iinstallationmanager.h>
8+
#include <uibase/imodinterface.h>
9+
#include <uibase/imodlist.h>
10+
#include <uibase/log.h>
11+
#include <uibase/report.h>
12+
#include <uibase/utility.h>
13+
14+
#include "fomodinstallerdialog.h"
15+
1616
using namespace MOBase;
1717

1818
InstallerFomod::InstallerFomod() : m_MOInfo(nullptr) {}

0 commit comments

Comments
 (0)