From 8adaf060ec6e8b47823818ecca066a4aec2d332d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Thu, 11 Jul 2024 21:40:07 +0200 Subject: [PATCH] Move to VCPKG. --- CMakeLists.txt | 7 +----- CMakePresets.json | 52 ++++++++++++++++++++++++++++++++++++++++++ appveyor.yml | 40 -------------------------------- src/CMakeLists.txt | 9 ++++++-- src/diagnosebasic.cpp | 14 ++++++------ src/diagnosebasic.h | 11 ++++----- src/diagnosebasic.json | 1 - vcpkg.json | 30 ++++++++++++++++++++++++ 8 files changed, 102 insertions(+), 62 deletions(-) create mode 100644 CMakePresets.json delete mode 100644 appveyor.yml delete mode 100644 src/diagnosebasic.json create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 839fca4..a5a3c62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required(VERSION 3.16) -if(DEFINED DEPENDENCIES_DIR) - include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake) -else() - include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake) -endif() - project(diagnose_basic) + add_subdirectory(src) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..023baf5 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,52 @@ +{ + "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" + }, + { + "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"], + "name": "vs2022-windows", + "toolset": "v143" + } + ], + "buildPresets": [ + { + "name": "vs2022-windows", + "resolvePackageReferences": "on", + "configurePreset": "vs2022-windows" + } + ], + "version": 4 +} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index ee1ef9d..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: 1.0.{build} -skip_branch_with_pr: true -image: Visual Studio 2019 -environment: - WEBHOOK_URL: - secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1Vbg57wBaeLhi49uGjxPw5GVujHku6kxN6ab89zhbS5GVeluR76GM83IbKV4Sh7udXzoYZZdg6YudtYHzdhCgUeiedpswbuczTq9ceIkkfSEWZuh/lMAAVVwvcGsJAnoPFw= -build_script: -- pwsh: >- - $ErrorActionPreference = 'Stop' - - git clone --depth=1 --no-single-branch https://github.com/ModOrganizer2/modorganizer-umbrella.git c:\projects\modorganizer-umbrella - - New-Item -ItemType Directory -Path c:\projects\modorganizer-build - - cd c:\projects\modorganizer-umbrella - - ($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH -eq $null) ? ($branch = $env:APPVEYOR_REPO_BRANCH) : ($branch = $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH) - - git checkout $(git show-ref --verify --quiet refs/remotes/origin/${branch} || echo '-b') ${branch} - - C:\Python37-x64\python.exe unimake.py -d c:\projects\modorganizer-build -s Appveyor_Build=True ${env:APPVEYOR_PROJECT_NAME} - - if($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode ) } -artifacts: -- path: vsbuild\src\RelWithDebInfo\diagnose_basic.dll - name: diagnose_basic_dll -- path: vsbuild\src\RelWithDebInfo\diagnose_basic.pdb - name: diagnose_basic_pdb -- path: vsbuild\src\RelWithDebInfo\diagnose_basic.lib - name: diagnose_basic_lib -on_success: - - ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER - - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - - ps: ./send.ps1 success $env:WEBHOOK_URL -on_failure: - - ps: Set-Location -Path $env:APPVEYOR_BUILD_FOLDER - - ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stdout.log - - ps: Push-AppveyorArtifact ${env:APPVEYOR_BUILD_FOLDER}\stderr.log - - ps: Invoke-RestMethod https://raw.githubusercontent.com/DiscordHooks/appveyor-discord-webhook/master/send.ps1 -o send.ps1 - - ps: ./send.ps1 failure $env:WEBHOOK_URL \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9eac92a..dd9e834 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 3.16) +find_package(mo2-cmake CONFIG REQUIRED) +find_package(mo2-uibase CONFIG REQUIRED) +find_package(Boost CONFIG REQUIRED COMPONENTS graph assign) + add_library(diagnose_basic SHARED) -mo2_configure_plugin(diagnose_basic WARNINGS OFF PRIVATE_DEPENDS boost) -mo2_install_target(diagnose_basic) +mo2_configure_plugin(diagnose_basic WARNINGS OFF) +target_link_libraries(diagnose_basic PRIVATE mo2::uibase Boost::assign Boost::graph) +mo2_install_plugin(diagnose_basic) diff --git a/src/diagnosebasic.cpp b/src/diagnosebasic.cpp index e81233b..1874c9e 100644 --- a/src/diagnosebasic.cpp +++ b/src/diagnosebasic.cpp @@ -19,13 +19,13 @@ #include "diagnosebasic.h" -#include "ifiletree.h" -#include "iplugingame.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/diagnosebasic.h b/src/diagnosebasic.h index 9789c4c..30ee3b5 100644 --- a/src/diagnosebasic.h +++ b/src/diagnosebasic.h @@ -20,22 +20,21 @@ along with this plugin. If not, see . #ifndef DIAGNOSEBASIC_H #define DIAGNOSEBASIC_H - -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include class DiagnoseBasic : public QObject, public MOBase::IPlugin, public MOBase::IPluginDiagnose { Q_OBJECT Q_INTERFACES(MOBase::IPlugin MOBase::IPluginDiagnose) #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) - Q_PLUGIN_METADATA(IID "org.tannin.DiagnoseBasic" FILE "diagnosebasic.json") + Q_PLUGIN_METADATA(IID "org.tannin.DiagnoseBasic") #endif public: diff --git a/src/diagnosebasic.json b/src/diagnosebasic.json deleted file mode 100644 index 69a88e3..0000000 --- a/src/diagnosebasic.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..cdd4d7f --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,30 @@ +{ + "dependencies": ["boost-assign", "boost-graph"], + "features": { + "standalone": { + "description": "Build Standalone.", + "dependencies": ["mo2-cmake"] + } + }, + "vcpkg-configuration": { + "default-registry": { + "kind": "git", + "repository": "https://github.com/Microsoft/vcpkg", + "baseline": "f61a294e765b257926ae9e9d85f96468a0af74e7" + }, + "registries": [ + { + "kind": "git", + "repository": "https://github.com/Microsoft/vcpkg", + "baseline": "f61a294e765b257926ae9e9d85f96468a0af74e7", + "packages": ["boost*", "boost-*"] + }, + { + "kind": "git", + "repository": "https://github.com/ModOrganizer2/vcpkg-registry", + "baseline": "b826771be1e4507f28daffa5f2d8ae0bcfa7bf13", + "packages": ["mo2-*"] + } + ] + } +}