Skip to content

Commit 3ecfdd5

Browse files
authored
Use CMake Presets
Use CMake Presets
1 parent b340c84 commit 3ecfdd5

File tree

8 files changed

+131
-29
lines changed

8 files changed

+131
-29
lines changed

.devcontainer/post-create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -ex
55
apt-get purge cmake -y
66

77
# Install required cmake version
8-
curl --location https://github.com/Kitware/CMake/releases/download/v3.31.6/cmake-3.31.6-linux-x86_64.sh --output /tmp/cmake.sh
8+
curl --location https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0-linux-x86_64.sh --output /tmp/cmake.sh
99
sh /tmp/cmake.sh --skip-license --prefix=/usr
1010
rm -rf /tmp/cmake.sh
1111

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ jobs:
1818
- name: Build application
1919
run: |
2020
sh .devcontainer/post-create.sh
21-
/opt/devkitpro/portlibs/wii/bin/powerpc-eabi-cmake -B $GITHUB_WORKSPACE/build -G Ninja
22-
cmake --build $GITHUB_WORKSPACE/build --verbose
21+
cmake --preset wii
22+
cmake --build --preset wii --verbose
2323
2424
- name: Prepare artifact
2525
run: |
26-
mkdir --parents --verbose /tmp/artifact/Wii-Tac-Toe
27-
mv --verbose build/Wii-Tac-Toe.dol /tmp/artifact/Wii-Tac-Toe/boot.dol
28-
cp --verbose Wii-Tac-Toe/* /tmp/artifact/Wii-Tac-Toe/
26+
cmake --install build/wii --verbose --prefix /tmp/artifact
2927
3028
- uses: actions/upload-artifact@v4
3129
with:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010

1111
# Windows thumbnail cache
1212
Thumbs.db
13+
14+
# User file
15+
CMakeUserPresets.json

.vscode/cmake-kits.json

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

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ All notable changes to this project will be documented in this file.
66

77
- Library update
88
- fmt 11.1.4
9-
- GRRMOD (afe20fa4c1d0245148dfa290fc916f14195e458d)
10-
- GRRLIB (b4b9b56f10c11c2e1838a1dd8a64ce6df1b0c258)
9+
- GRRMOD (670f84601a5086c4d3eeb03bd3041e3c0a7f0ace)
10+
- GRRLIB (aa61ecacc830deccf19ab91148ec9273a3d9f7a1)
1111

1212
## 1.1.0
1313

CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ FetchContent_Declare(fmt
2222
)
2323
FetchContent_Declare(grrlib
2424
GIT_REPOSITORY https://github.com/GRRLIB/GRRLIB.git
25-
GIT_TAG b4b9b56f10c11c2e1838a1dd8a64ce6df1b0c258
25+
GIT_TAG aa61ecacc830deccf19ab91148ec9273a3d9f7a1
2626
)
2727
FetchContent_Declare(grrmod
28-
URL https://codeload.github.com/GRRLIB/GRRMOD/tar.gz/afe20fa4c1d0245148dfa290fc916f14195e458d
28+
URL https://codeload.github.com/GRRLIB/GRRMOD/tar.gz/670f84601a5086c4d3eeb03bd3041e3c0a7f0ace
2929
)
30+
set(FMT_INSTALL OFF CACHE BOOL "Don't install" FORCE)
31+
set(GRRLIB_INSTALL OFF CACHE BOOL "Don't install" FORCE)
32+
set(GRRMOD_INSTALL OFF CACHE BOOL "Don't install" FORCE)
3033
set(GRRMOD_USE_MP3 OFF CACHE BOOL "Don't use MP3" FORCE)
3134
FetchContent_MakeAvailable(fmt grrlib grrmod)
3235

@@ -80,3 +83,16 @@ target_link_libraries(Wii-Tac-Toe PRIVATE
8083
)
8184

8285
ogc_create_dol(Wii-Tac-Toe)
86+
87+
get_target_property(DOL_FILE Wii-Tac-Toe DKP_FILE)
88+
install(FILES "${DOL_FILE}" DESTINATION "Wii-Tac-Toe" RENAME "boot.dol")
89+
install(FILES
90+
"${CMAKE_CURRENT_SOURCE_DIR}/Wii-Tac-Toe/icon.png"
91+
"${CMAKE_CURRENT_SOURCE_DIR}/Wii-Tac-Toe/meta.xml"
92+
DESTINATION "Wii-Tac-Toe"
93+
)
94+
95+
set(CPACK_PACKAGE_NAME "wii-tac-toe")
96+
set(CPACK_GENERATOR "ZIP")
97+
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
98+
include(CPack)

CMakePresets.json

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"version": 10,
3+
"configurePresets": [
4+
{
5+
"name": "base",
6+
"generator": "Ninja",
7+
"binaryDir": "${sourceDir}/build/${presetName}",
8+
"hidden": true
9+
},
10+
{
11+
"name": "wiiu",
12+
"displayName": "Wii U Config",
13+
"description": "Build using Wii U toolchain",
14+
"toolchainFile": "$penv{DEVKITPRO}/cmake/WiiU.cmake",
15+
"inherits": "base"
16+
},
17+
{
18+
"name": "wii",
19+
"displayName": "Wii Config",
20+
"description": "Build using Wii toolchain",
21+
"toolchainFile": "$penv{DEVKITPRO}/cmake/Wii.cmake",
22+
"inherits": "base"
23+
},
24+
{
25+
"name": "gamecube",
26+
"displayName": "GameCube Config",
27+
"description": "Build using GameCube toolchain",
28+
"toolchainFile": "$penv{DEVKITPRO}/cmake/GameCube.cmake",
29+
"inherits": "base"
30+
}
31+
],
32+
"buildPresets": [
33+
{
34+
"name": "wiiu",
35+
"displayName": "Wii U Build",
36+
"configurePreset": "wiiu"
37+
},
38+
{
39+
"name": "wii",
40+
"displayName": "Wii Build",
41+
"configurePreset": "wii"
42+
},
43+
{
44+
"name": "gamecube",
45+
"displayName": "GameCube Build",
46+
"configurePreset": "gamecube"
47+
}
48+
],
49+
"packagePresets": [
50+
{
51+
"name": "wii",
52+
"displayName": "Wii Package",
53+
"configurePreset": "wii",
54+
"generators": [
55+
"ZIP"
56+
]
57+
}
58+
],
59+
"workflowPresets": [
60+
{
61+
"name": "wiiu",
62+
"displayName": "Wii U Workflow",
63+
"steps": [
64+
{
65+
"type": "configure",
66+
"name": "wiiu"
67+
},
68+
{
69+
"type": "build",
70+
"name": "wiiu"
71+
}
72+
]
73+
},
74+
{
75+
"name": "wii",
76+
"displayName": "Wii Workflow",
77+
"steps": [
78+
{
79+
"type": "configure",
80+
"name": "wii"
81+
},
82+
{
83+
"type": "build",
84+
"name": "wii"
85+
}
86+
]
87+
},
88+
{
89+
"name": "gamecube",
90+
"displayName": "GameCube Workflow",
91+
"steps": [
92+
{
93+
"type": "configure",
94+
"name": "gamecube"
95+
},
96+
{
97+
"type": "build",
98+
"name": "gamecube"
99+
}
100+
]
101+
}
102+
]
103+
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ To compile:
2828

2929
```text
3030
pacman --sync --needed --noconfirm ppc-mxml ppc-libpng ppc-freetype
31-
/opt/devkitpro/portlibs/wii/bin/powerpc-eabi-cmake -B build
32-
cmake --build build
31+
cmake --workflow wii
3332
```

0 commit comments

Comments
 (0)