Skip to content

Commit

Permalink
WIP vcpkg
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandrePTJ committed Jul 26, 2024
1 parent 5be689e commit 2577072
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 123 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ jobs:

- name: Configure
run: |
cmake --preset release-win
cmake --preset release
- name: Build
run: |
cmake --build --preset release-win
cmake --build --preset release
- name: Create Windows package
run: |
cmake --build --preset release-win --target package
cmake --build --preset release --target package
# Create release if on built on a tag
- if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -73,7 +73,7 @@ jobs:
with:
allowUpdates: true
draft: true
artifacts: 'cmake-build-release-win/Kemai-*.msi'
artifacts: 'cmake-build-release/Kemai-*.msi'

# Create continuous release on some branches
- if: github.ref == 'refs/heads/develop'
Expand All @@ -85,7 +85,7 @@ jobs:
allowUpdates: true
updateOnlyUnreleased: true
prerelease: true
artifacts: 'cmake-build-release-win/Kemai-*.msi'
artifacts: 'cmake-build-release/Kemai-*.msi'
- if: github.ref == 'refs/heads/feature/98-break-ui'
name: Create/Update prerelease
uses: ncipollo/release-action@v1
Expand All @@ -95,14 +95,14 @@ jobs:
allowUpdates: true
updateOnlyUnreleased: true
prerelease: true
artifacts: 'cmake-build-release-win/Kemai-*.msi'
artifacts: 'cmake-build-release/Kemai-*.msi'

MacOSJob:
name: MacOS
runs-on: macos-latest
strategy:
matrix:
preset: ["release-macos", "release-macos-noupdate"]
preset: ["release", "release-macos-noupdate"]
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ out/

# ---> Visual Studio
.vs/

# ---> vcpkg
vcpkg-configuration.json
27 changes: 5 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Options
option(KEMAI_ENABLE_UPDATE_CHECK "Allow Kemai to check for update from Github releases" ON)
option(KEMAI_BUILD_LOCAL_DEPENDENCIES "Download and build dependencies (except Qt6)" ON)

# Install dependencies sources to build if required
if (KEMAI_BUILD_LOCAL_DEPENDENCIES)
set(SPDLOG_FMT_EXTERNAL ON)

include(FetchContent)
FetchContent_Declare(fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 10.2.1
OVERRIDE_FIND_PACKAGE)
FetchContent_Declare(magic_enum
GIT_REPOSITORY https://github.com/Neargye/magic_enum.git
GIT_TAG v0.9.5
OVERRIDE_FIND_PACKAGE)
FetchContent_Declare(spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.14.0
OVERRIDE_FIND_PACKAGE)
FetchContent_Declare(QtAwesome
GIT_REPOSITORY https://github.com/gamecreature/QtAwesome.git
GIT_TAG font-awesome-6.5.1
OVERRIDE_FIND_PACKAGE)
endif (KEMAI_BUILD_LOCAL_DEPENDENCIES)
include(FetchContent)
FetchContent_Declare(QtAwesome
GIT_REPOSITORY https://github.com/gamecreature/QtAwesome.git
GIT_TAG font-awesome-6.5.1
OVERRIDE_FIND_PACKAGE)

# Find external dependencies
find_package(fmt REQUIRED)
Expand Down
150 changes: 56 additions & 94 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,96 +1,58 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"hidden": true,
"displayName": "Default Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/cmake-build-${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "/usr"
}
},
{
"name": "default-windows",
"hidden": true,
"cacheVariables": {
"CMAKE_PREFIX_PATH": "c:/Qt/6.7.2/msvc2019_64",
"CMAKE_INSTALL_PREFIX": "dist"
}
},
{
"name": "default-macos",
"hidden": true,
"cacheVariables": {
"CMAKE_PREFIX_PATH": "$env{HOME}/Qt/6.7.2/macos",
"CMAKE_INSTALL_PREFIX": "dist"
}
},
{
"name": "debug",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "release",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "debug-win",
"inherits": ["default-windows", "debug"]
},
{
"name": "release-win",
"inherits": ["default-windows", "release"]
},
{
"name": "release-macos",
"inherits": ["default-macos", "release"]
},
{
"name": "release-macos-noupdate",
"inherits": ["default-macos", "release"],
"cacheVariables": {
"KEMAI_ENABLE_UPDATE_CHECK": "OFF"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "debug-win",
"configurePreset": "debug-win"
},
{
"name": "release-win",
"configurePreset": "release-win"
},
{
"name": "release-macos",
"configurePreset": "release-macos"
},
{
"name": "release-macos-noupdate",
"configurePreset": "release-macos-noupdate"
}
]
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"displayName": "Default Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/cmake-build-${presetName}",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
},
{
"name": "debug",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "release",
"inherits": "default",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "release-macos-noupdate",
"inherits": "release",
"cacheVariables": {
"KEMAI_ENABLE_UPDATE_CHECK": "OFF"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release",
"configurePreset": "release"
},
{
"name": "release-macos-noupdate",
"configurePreset": "release-macos-noupdate"
}
]
}
7 changes: 7 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dependencies": [
"fmt",
"magic-enum",
"spdlog"
]
}

0 comments on commit 2577072

Please sign in to comment.