Skip to content

Commit b4cbf12

Browse files
committed
Move to VCPKG.
1 parent ff7e4cb commit b4cbf12

File tree

12 files changed

+127
-74
lines changed

12 files changed

+127
-74
lines changed

.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 Quick Plugin
1+
name: Build Installer Quick
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 Quick 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 Quick
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 Quick
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
@@ -1,10 +1,4 @@
11
cmake_minimum_required(VERSION 3.16)
22

3-
if(DEFINED DEPENDENCIES_DIR)
4-
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
5-
else()
6-
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
7-
endif()
8-
93
project(installer_quick)
104
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: 6 additions & 2 deletions
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_quick SHARED)
4-
mo2_configure_plugin(installer_quick WARNINGS OFF)
5-
mo2_install_target(installer_quick)
7+
mo2_configure_plugin(installer_quick WARNINGS 4)
8+
target_link_libraries(installer_quick PRIVATE mo2::uibase)
9+
mo2_install_plugin(installer_quick)

src/SConscript

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

src/installerQuick.pro

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

src/installerquick.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#include "installerquick.h"
22

3-
#include "igamefeatures.h"
4-
#include "iplugingame.h"
5-
#include "log.h"
6-
73
#include <QDialog>
84
#include <QtPlugin>
95

6+
#include <uibase/game_features/igamefeatures.h>
7+
#include <uibase/iplugingame.h>
8+
#include <uibase/log.h>
9+
1010
#include "simpleinstalldialog.h"
1111

1212
using namespace MOBase;
@@ -65,7 +65,7 @@ bool InstallerQuick::isManualInstaller() const
6565

6666
bool InstallerQuick::isDataTextArchiveTopLayer(std::shared_ptr<const IFileTree> tree,
6767
QString const& dataFolderName,
68-
ModDataChecker* checker) const
68+
ModDataChecker*) const
6969
{
7070
// A "DataText" archive is defined as having exactly one folder named like
7171
// `dataFolderName` and one or more "useless" files (text files, pdf, or images).

src/installerquick.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#ifndef INSTALLERQUICK_H
22
#define INSTALLERQUICK_H
33

4-
#include <iplugininstallersimple.h>
5-
#include <moddatachecker.h>
4+
#include <uibase/game_features/moddatachecker.h>
5+
#include <uibase/iplugininstallersimple.h>
66

77
class InstallerQuick : public MOBase::IPluginInstallerSimple
88
{
99
Q_OBJECT
1010
Q_INTERFACES(MOBase::IPlugin MOBase::IPluginInstaller MOBase::IPluginInstallerSimple)
1111
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
12-
Q_PLUGIN_METADATA(IID "org.tannin.InstallerQuick" FILE "installerquick.json")
12+
Q_PLUGIN_METADATA(IID "org.tannin.InstallerQuick")
1313
#endif
1414

1515
public:

src/installerquick.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/simpleinstalldialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +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 "simpleinstalldialog.h"
2120
#include "ui_simpleinstalldialog.h"
21+
2222
#include <QLineEdit>
2323

2424
#include <QComboBox>

0 commit comments

Comments
 (0)