Skip to content

Commit 2ea4037

Browse files
committed
move to meson
1 parent 717af47 commit 2ea4037

File tree

10 files changed

+308
-176
lines changed

10 files changed

+308
-176
lines changed

.github/workflows/main.yml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
name: build
3+
4+
on:
5+
push:
6+
branches: [ master ]
7+
tags:
8+
- v*
9+
pull_request:
10+
branches: [ master ]
11+
12+
# matrix:
13+
# maya: [2024]
14+
# os: [macos-latest, ubuntu-latest, windows-latest]
15+
# include:
16+
# - maya: 2024
17+
# update: 2
18+
19+
jobs:
20+
compile_plugin:
21+
strategy:
22+
matrix:
23+
maya: [2022, 2023, 2024, 2025]
24+
os: [macos-13, macos-latest, ubuntu-latest, windows-latest]
25+
include:
26+
# Add the maya update versions here
27+
- maya: 2022
28+
update: 5
29+
- maya: 2023
30+
update: 3
31+
- maya: 2024
32+
update: 2
33+
- maya: 2025
34+
update: 1
35+
36+
# cross-compiling is annoying so just fall back to macos-13
37+
exclude:
38+
- os: macos-latest
39+
maya: 2022
40+
- os: macos-latest
41+
maya: 2023
42+
- os: macos-13
43+
maya: 2024
44+
- os: macos-13
45+
maya: 2025
46+
47+
fail-fast: false
48+
49+
runs-on: ${{ matrix.os }}
50+
steps:
51+
- uses: actions/checkout@v4
52+
- run: git fetch --force --tags origin
53+
54+
- name: Get Maya Devkit
55+
id: get-devkit
56+
uses: blurstudio/mayaModuleActions/getMayaDevkit@v1
57+
with:
58+
maya: ${{ matrix.maya }}
59+
update: ${{ matrix.update }}
60+
61+
- name: Build
62+
uses: blurstudio/mayaModuleActions/mesonBuild@v1
63+
with:
64+
setup-args: >
65+
-Dmaya:maya_version=${{ matrix.maya }}
66+
-Dmaya:maya_devkit_base=${{ steps.get-devkit.outputs.devkit-path }}
67+
--buildtype release
68+
--backend ninja
69+
70+
- name: Upload Artifacts
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: ${{ runner.os }}-${{ matrix.maya }}-plugin
74+
path: build/*.${{ steps.get-devkit.outputs.plugin-ext }}
75+
if-no-files-found: error
76+
77+
upload_release:
78+
name: Upload release
79+
needs: compile_plugin
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
- run: git fetch --force --tags origin
84+
- name: 'Get Previous tag'
85+
id: previoustag
86+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
87+
with:
88+
fallback: 0.0.1
89+
90+
- name: Package
91+
uses: blurstudio/mayaModuleActions/packageMayaModule@v1
92+
with:
93+
module-name: blurNoise
94+
folder-list: scripts icons
95+
version: ${{ steps.previoustag.outputs.tag }}
96+
97+
- name: Upload distribution
98+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
99+
uses: softprops/action-gh-release@v1
100+
with:
101+
token: "${{ secrets.GITHUB_TOKEN }}"
102+
prerelease: false
103+
files: |
104+
*.zip

CMakeLists.txt

-29
This file was deleted.

mayaConfigure.bat

-19
This file was deleted.

meson.build

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
project('blurNoise', 'cpp', default_options: ['cpp_std=c++20'])
2+
3+
fs = import('fs')
4+
maya_dep = dependency('maya')
5+
maya_name_suffix = maya_dep.get_variable('name_suffix')
6+
maya_version = maya_dep.get_variable('maya_version')
7+
8+
if fs.is_file('src/version.h')
9+
message('Using existing version.h')
10+
version_h = 'src/version.h'
11+
else
12+
git = find_program('git', native: true, required: true)
13+
version_h = vcs_tag(
14+
command: [git, 'describe', '--tags', '--match', 'v[0-9]*', '--dirty=+'],
15+
fallback: 'v0.0.1',
16+
input: 'src/version.h.in',
17+
output: 'version.h',
18+
)
19+
endif
20+
21+
source_files = files([
22+
'src/OpenSimplex2F.cpp',
23+
'src/blurNoise.cpp',
24+
'src/pluginMain.cpp',
25+
])
26+
27+
outlib = shared_library(
28+
meson.project_name(),
29+
source_files + version_h,
30+
install: true,
31+
install_dir : meson.global_source_root() / 'output_Maya' + maya_version,
32+
include_directories : include_directories(['src']),
33+
dependencies : maya_dep,
34+
name_prefix : '',
35+
name_suffix : maya_name_suffix,
36+
)
37+

modules/FindMaya.cmake

-127
This file was deleted.

quick_compile.bat

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
setlocal
2+
3+
SET MAYA_VERSION=2024
4+
REM "vs" "ninja"
5+
REM use VS for the debugger, otherwise use NINJA
6+
REM Until I figure out how to debug using nvim
7+
SET BACKEND=vs
8+
REM "debug" "debugoptimized" "release"
9+
SET BUILDTYPE=debug
10+
SET BUILDDIR=mayabuild_%BUILDTYPE%_%MAYA_VERSION%_%BACKEND%
11+
12+
if not exist %BUILDDIR%\ (
13+
meson setup %BUILDDIR% ^
14+
-Dmaya:maya_version=%MAYA_VERSION% ^
15+
-Dmaya:maya_link_qt=true ^
16+
--buildtype %BUILDTYPE% ^
17+
--backend %BACKEND% --vsenv
18+
)
19+
20+
if exist %BUILDDIR%\ (
21+
meson compile -C %BUILDDIR%
22+
meson install -C %BUILDDIR%
23+
)
24+
25+
pause

src/pluginMain.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#include <maya/MFnPlugin.h>
22
#include <maya/MGlobal.h>
33
#include "blurNoise.h"
4+
#include "version.h"
45

56
MStatus initializePlugin(MObject obj) {
67
MStatus result;
7-
MFnPlugin plugin(obj, "Blur Studio", "1.0", "Any");
8+
MFnPlugin plugin(obj, "Blur Studio", VERSION_STRING, "Any");
89
result = plugin.registerNode(
910
DEFORMER_NAME,
1011
blurNoise::id,

src/version.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
#define VERSION_STRING "@VCS_TAG@"
3+

0 commit comments

Comments
 (0)