Skip to content

Commit 3c5372b

Browse files
committed
Move to VCPKG.
1 parent 52d8179 commit 3c5372b

14 files changed

+148
-101
lines changed

.github/workflows/build.yml

+35-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,47 @@
1-
name: Build Installer Manual Plugin
1+
name: Build Installer Manual
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 Manual 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 Manual
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 Manual
47+
run: cmake --build vsbuild --config RelWithDebInfo --target INSTALL

CMakeLists.txt

-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@ cmake_minimum_required(VERSION 3.16)
22

33
project(installer_manual)
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

+60
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

+6-2
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_manual SHARED)
4-
mo2_configure_plugin(installer_manual WARNINGS OFF)
5-
mo2_install_target(installer_manual)
7+
mo2_configure_plugin(installer_manual WARNINGS 4)
8+
target_link_libraries(installer_manual PRIVATE mo2::uibase)
9+
mo2_install_plugin(installer_manual)

src/SConscript

-19
This file was deleted.

src/archivetree.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2323
#include <QDragMoveEvent>
2424
#include <QMessageBox>
2525

26-
#include <ifiletree.h>
27-
#include <log.h>
28-
#include <report.h>
26+
#include <uibase/ifiletree.h>
27+
#include <uibase/log.h>
28+
#include <uibase/report.h>
2929

3030
using namespace MOBase;
3131

@@ -352,8 +352,9 @@ void ArchiveTreeWidget::dragEnterEvent(QDragEnterEvent* event)
352352

353353
void ArchiveTreeWidget::dragMoveEvent(QDragMoveEvent* event)
354354
{
355-
if (!testMovePossible(static_cast<ArchiveTreeWidgetItem*>(currentItem()),
356-
static_cast<ArchiveTreeWidgetItem*>(itemAt(event->pos())))) {
355+
if (!testMovePossible(
356+
static_cast<ArchiveTreeWidgetItem*>(currentItem()),
357+
static_cast<ArchiveTreeWidgetItem*>(itemAt(event->position().toPoint())))) {
357358
event->ignore();
358359
} else {
359360
QTreeWidget::dragMoveEvent(event);
@@ -402,7 +403,8 @@ void ArchiveTreeWidget::dropEvent(QDropEvent* event)
402403
event->ignore();
403404

404405
// target widget (should be a directory)
405-
auto* target = static_cast<ArchiveTreeWidgetItem*>(itemAt(event->pos()));
406+
auto* target =
407+
static_cast<ArchiveTreeWidgetItem*>(itemAt(event->position().toPoint()));
406408

407409
// this should not really happen because it is prevent by dragMoveEvent
408410
if (target->flags().testFlag(Qt::ItemNeverHasChildren)) {

src/archivetree.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2222

2323
#include <QTreeWidget>
2424

25-
#include "ifiletree.h"
25+
#include <uibase/ifiletree.h>
2626

2727
class ArchiveTreeWidget;
2828

src/installdialog.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2020
#include "installdialog.h"
2121
#include "ui_installdialog.h"
2222

23-
#include "log.h"
24-
#include "report.h"
25-
#include "utility.h"
26-
2723
#include <QCompleter>
2824
#include <QInputDialog>
2925
#include <QMenu>
3026
#include <QMessageBox>
3127
#include <QMetaType>
3228

29+
#include <uibase/log.h>
30+
#include <uibase/report.h>
31+
#include <uibase/utility.h>
32+
3333
using namespace MOBase;
3434

3535
InstallDialog::InstallDialog(

src/installdialog.h

+9-8
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,22 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2020
#ifndef INSTALLDIALOG_H
2121
#define INSTALLDIALOG_H
2222

23-
#include "archivetree.h"
24-
#include "tutorabledialog.h"
25-
#include <guessedvalue.h>
26-
#include <ifiletree.h>
27-
28-
#include <iplugingame.h>
29-
#include <moddatachecker.h>
30-
3123
#include <QDialog>
3224
#include <QProgressDialog>
3325
#include <QTreeWidgetItem>
3426
#include <QUuid>
27+
28+
#include <uibase/game_features/moddatachecker.h>
29+
#include <uibase/guessedvalue.h>
30+
#include <uibase/ifiletree.h>
31+
#include <uibase/iplugingame.h>
32+
#include <uibase/tutorabledialog.h>
33+
3534
#define WIN32_LEAN_AND_MEAN
3635
#include <Windows.h>
3736

37+
#include "archivetree.h"
38+
3839
namespace Ui
3940
{
4041
class InstallDialog;

src/installerManual.pro

-41
This file was deleted.

src/installermanual.cpp

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

2020
#include "installermanual.h"
2121

22-
#include <igamefeatures.h>
23-
#include <iinstallationmanager.h>
24-
#include <iplugingame.h>
25-
#include <moddatachecker.h>
26-
#include <utility.h>
27-
2822
#include <QDialog>
2923
#include <QtPlugin>
3024

3125
#include <Shellapi.h>
3226

27+
#include <uibase/game_features/igamefeatures.h>
28+
#include <uibase/game_features/moddatachecker.h>
29+
#include <uibase/iinstallationmanager.h>
30+
#include <uibase/iplugingame.h>
31+
#include <uibase/utility.h>
32+
3333
#include "installdialog.h"
3434

3535
using namespace MOBase;

src/installermanual.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
2020
#ifndef INSTALLERMANUAL_H
2121
#define INSTALLERMANUAL_H
2222

23-
#include <imoinfo.h>
24-
#include <iplugininstallersimple.h>
23+
#include <uibase/imoinfo.h>
24+
#include <uibase/iplugininstallersimple.h>
2525

2626
class InstallerManual : public MOBase::IPluginInstallerSimple
2727
{
2828
Q_OBJECT
2929
Q_INTERFACES(MOBase::IPlugin MOBase::IPluginInstaller MOBase::IPluginInstallerSimple)
3030
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
31-
Q_PLUGIN_METADATA(IID "org.tannin.InstallerManual" FILE "installermanual.json")
31+
Q_PLUGIN_METADATA(IID "org.tannin.InstallerManual")
3232
#endif
3333

3434
public:

src/installermanual.json

-1
This file was deleted.

vcpkg.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"dependencies": ["mo2-cmake"],
3+
"features": {
4+
"standalone": {
5+
"description": "Build Standalone.",
6+
"dependencies": ["mo2-uibase"]
7+
}
8+
},
9+
"vcpkg-configuration": {
10+
"default-registry": {
11+
"kind": "git",
12+
"repository": "https://github.com/ModOrganizer2/vcpkg-registry",
13+
"baseline": "d194ec4e14052784518d5e9f1c5ccac16de49c2c"
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)