Skip to content

Commit

Permalink
Move to VCPKG.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Oct 13, 2024
1 parent 52d8179 commit f9290bb
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 101 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
name: Build Installer Manual Plugin
name: Build Installer Manual

on:
push:
branches: master
pull_request:
types: [opened, synchronize, reopened]

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

jobs:
build:
runs-on: windows-2022
steps:
- name: Build Installer Manual Plugin
uses: ModOrganizer2/build-with-mob-action@master
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
mo2-dependencies: cmake_common uibase
setup-python: false
version: 6.7.0
modules:
cache: true

- uses: actions/checkout@v4

- name: "Set environmental variables"
shell: bash
run: |
echo "VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
- name: Configure Installer Manual
shell: pwsh
run: |
cmake --preset vs2022-windows-standalone `
"-DCMAKE_PREFIX_PATH=${env:QT_ROOT_DIR}\msvc2019_64" `
"-DCMAKE_INSTALL_PREFIX=install"
- name: Build Installer Manual
run: cmake --build vsbuild --config RelWithDebInfo --target INSTALL
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@ cmake_minimum_required(VERSION 3.16)

project(installer_manual)

if(DEFINED DEPENDENCIES_DIR)
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
else()
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
endif()

add_subdirectory(src)
60 changes: 60 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"configurePresets": [
{
"errors": {
"deprecated": true
},
"hidden": true,
"name": "cmake-dev",
"warnings": {
"deprecated": true,
"dev": true
}
},
{
"cacheVariables": {
"VCPKG_MANIFEST_NO_DEFAULT_FEATURES": {
"type": "BOOL",
"value": "ON"
}
},
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"hidden": true,
"name": "vcpkg"
},
{
"hidden": true,
"inherits": ["vcpkg"],
"name": "vcpkg-dev"
},
{
"binaryDir": "${sourceDir}/vsbuild",
"architecture": {
"strategy": "set",
"value": "x64"
},
"cacheVariables": {
"CMAKE_CXX_FLAGS": "/EHsc /MP /W4",
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "x64-windows-static-md"
}
},
"generator": "Visual Studio 17 2022",
"inherits": ["cmake-dev", "vcpkg-dev"],
"name": "vs2022-windows",
"toolset": "v143"
},
{
"cacheVariables": {
"VCPKG_MANIFEST_FEATURES": {
"type": "STRING",
"value": "standalone"
}
},
"inherits": "vs2022-windows",
"name": "vs2022-windows-standalone"
}
],
"version": 4
}
8 changes: 6 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.16)

find_package(mo2-cmake CONFIG REQUIRED)
find_package(mo2-uibase CONFIG REQUIRED)

add_library(installer_manual SHARED)
mo2_configure_plugin(installer_manual WARNINGS OFF)
mo2_install_target(installer_manual)
mo2_configure_plugin(installer_manual WARNINGS 4)
target_link_libraries(installer_manual PRIVATE mo2::uibase)
mo2_install_plugin(installer_manual)
19 changes: 0 additions & 19 deletions src/SConscript

This file was deleted.

14 changes: 8 additions & 6 deletions src/archivetree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QDragMoveEvent>
#include <QMessageBox>

#include <ifiletree.h>
#include <log.h>
#include <report.h>
#include <uibase/ifiletree.h>
#include <uibase/log.h>
#include <uibase/report.h>

using namespace MOBase;

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

void ArchiveTreeWidget::dragMoveEvent(QDragMoveEvent* event)
{
if (!testMovePossible(static_cast<ArchiveTreeWidgetItem*>(currentItem()),
static_cast<ArchiveTreeWidgetItem*>(itemAt(event->pos())))) {
if (!testMovePossible(
static_cast<ArchiveTreeWidgetItem*>(currentItem()),
static_cast<ArchiveTreeWidgetItem*>(itemAt(event->position().toPoint())))) {
event->ignore();
} else {
QTreeWidget::dragMoveEvent(event);
Expand Down Expand Up @@ -402,7 +403,8 @@ void ArchiveTreeWidget::dropEvent(QDropEvent* event)
event->ignore();

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

// this should not really happen because it is prevent by dragMoveEvent
if (target->flags().testFlag(Qt::ItemNeverHasChildren)) {
Expand Down
2 changes: 1 addition & 1 deletion src/archivetree.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.

#include <QTreeWidget>

#include "ifiletree.h"
#include <uibase/ifiletree.h>

class ArchiveTreeWidget;

Expand Down
8 changes: 4 additions & 4 deletions src/installdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "installdialog.h"
#include "ui_installdialog.h"

#include "log.h"
#include "report.h"
#include "utility.h"

#include <QCompleter>
#include <QInputDialog>
#include <QMenu>
#include <QMessageBox>
#include <QMetaType>

#include <uibase/log.h>
#include <uibase/report.h>
#include <uibase/utility.h>

using namespace MOBase;

InstallDialog::InstallDialog(
Expand Down
17 changes: 9 additions & 8 deletions src/installdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#ifndef INSTALLDIALOG_H
#define INSTALLDIALOG_H

#include "archivetree.h"
#include "tutorabledialog.h"
#include <guessedvalue.h>
#include <ifiletree.h>

#include <iplugingame.h>
#include <moddatachecker.h>

#include <QDialog>
#include <QProgressDialog>
#include <QTreeWidgetItem>
#include <QUuid>

#include <uibase/game_features/moddatachecker.h>
#include <uibase/guessedvalue.h>
#include <uibase/ifiletree.h>
#include <uibase/iplugingame.h>
#include <uibase/tutorabledialog.h>

#define WIN32_LEAN_AND_MEAN
#include <Windows.h>

#include "archivetree.h"

namespace Ui
{
class InstallDialog;
Expand Down
41 changes: 0 additions & 41 deletions src/installerManual.pro

This file was deleted.

12 changes: 6 additions & 6 deletions src/installermanual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.

#include "installermanual.h"

#include <igamefeatures.h>
#include <iinstallationmanager.h>
#include <iplugingame.h>
#include <moddatachecker.h>
#include <utility.h>

#include <QDialog>
#include <QtPlugin>

#include <Shellapi.h>

#include <uibase/game_features/igamefeatures.h>
#include <uibase/game_features/moddatachecker.h>
#include <uibase/iinstallationmanager.h>
#include <uibase/iplugingame.h>
#include <uibase/utility.h>

#include "installdialog.h"

using namespace MOBase;
Expand Down
6 changes: 3 additions & 3 deletions src/installermanual.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#ifndef INSTALLERMANUAL_H
#define INSTALLERMANUAL_H

#include <imoinfo.h>
#include <iplugininstallersimple.h>
#include <uibase/imoinfo.h>
#include <uibase/iplugininstallersimple.h>

class InstallerManual : public MOBase::IPluginInstallerSimple
{
Q_OBJECT
Q_INTERFACES(MOBase::IPlugin MOBase::IPluginInstaller MOBase::IPluginInstallerSimple)
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_PLUGIN_METADATA(IID "org.tannin.InstallerManual" FILE "installermanual.json")
Q_PLUGIN_METADATA(IID "org.tannin.InstallerManual")
#endif

public:
Expand Down
1 change: 0 additions & 1 deletion src/installermanual.json

This file was deleted.

15 changes: 15 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"features": {
"standalone": {
"description": "Build Standalone.",
"dependencies": ["mo2-cmake", "mo2-uibase"]
}
},
"vcpkg-configuration": {
"default-registry": {
"kind": "git",
"repository": "https://github.com/ModOrganizer2/vcpkg-registry",
"baseline": "d194ec4e14052784518d5e9f1c5ccac16de49c2c"
}
}
}

0 comments on commit f9290bb

Please sign in to comment.